Browse Source

Flowchart component automatically selected in LuaBindings

master
Chris Gregan 9 years ago
parent
commit
36998eee62
  1. 12
      Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs

12
Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs vendored

@ -76,6 +76,18 @@ namespace Fungus
string keyName = objectProp.objectReferenceValue.name;
LuaBindings luaBindings = target as LuaBindings;
element.FindPropertyRelative("key").stringValue = GetUniqueKey(luaBindings, keyName.ToLower(), index);
// Auto select any Flowchart component in the object
GameObject go = objectProp.objectReferenceValue as GameObject;
if (go != null)
{
Component flowchart = go.GetComponent("Fungus.Flowchart");
if (flowchart != null)
{
SerializedProperty componentProp = element.FindPropertyRelative("component");
componentProp.objectReferenceValue = flowchart;
}
}
}
if (objectProp.objectReferenceValue != null)

Loading…
Cancel
Save