From 36998eee6261a668d42d7a8801b8848129bc45a2 Mon Sep 17 00:00:00 2001 From: Chris Gregan Date: Fri, 13 May 2016 18:24:47 +0100 Subject: [PATCH] Flowchart component automatically selected in LuaBindings --- .../FungusLua/Scripts/Editor/LuaBindingsEditor.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs index 1c289b72..5d048723 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/LuaBindingsEditor.cs @@ -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)