Skip to content

Commit

Permalink
Fixed lua (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkris33 authored Aug 18, 2016
1 parent 7be0c9b commit 8bda55f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Assets/Scripts/Models/Furniture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using System.Xml.Schema;
using System.Xml.Serialization;
using MoonSharp.Interpreter;
using MoonSharp;
using MoonSharp.Interpreter.Interop;


// InstalledObjects are things like walls, doors, and furniture (e.g. a sofa)
Expand Down Expand Up @@ -360,6 +362,15 @@ protected bool DEFAULT__IsValidPosition(Tile t)
return true;
}

[MoonSharpVisible(true)]
private void UpdateOnChanged(Furniture furn)
{
if (cbOnChanged != null)
{
cbOnChanged(furn);
}
}

public XmlSchema GetSchema()
{
return null;
Expand Down
6 changes: 1 addition & 5 deletions Assets/StreamingAssets/LUA/Furniture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ function OnUpdate_Door( furniture, deltaTime )

furniture.SetParameter("openness", Clamp01(furniture.GetParameter("openness")) )

if (furniture.cbOnChanged != nil) then
furniture.cbOnChanged(furniture)
end


furniture.UpdateOnChanged(furniture);
end

function IsEnterable_Door( furniture )
Expand Down

0 comments on commit 8bda55f

Please sign in to comment.