diff --git a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs index eea9cbc5..15c373c0 100644 --- a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs @@ -1,5 +1,6 @@ using UnityEditor; using UnityEngine; +using System; using System.Collections; using System.Collections.Generic; @@ -47,7 +48,7 @@ namespace Fungus.Script return result; } - static public string VariableField(GUIContent label, FungusScript fungusScript, string variableKey, ref VariableType variableType) + static public string VariableField(GUIContent label, FungusScript fungusScript, string variableKey, ref VariableType variableType, Func filter = null) { List keys = new List(); keys.Add(""); @@ -55,6 +56,15 @@ namespace Fungus.Script for (int i = 0; i < fungusScript.variables.Count; ++i) { Variable v = fungusScript.variables[i]; + + if (filter != null) + { + if (!filter(v)) + { + continue; + } + } + keys.Add(v.key); if (v.key == variableKey && index == 0) diff --git a/Assets/Fungus/Editor/FungusScript/SetVariableEditor.cs b/Assets/Fungus/Editor/FungusScript/SetVariableEditor.cs index 36fafafa..25e7fafd 100644 --- a/Assets/Fungus/Editor/FungusScript/SetVariableEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/SetVariableEditor.cs @@ -24,6 +24,7 @@ namespace Fungus.Script fungusScript, t.variableKey, ref variableType); + if (variableKey != t.variableKey) { diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index fb949d62..dafab6bb 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ