Browse Source

Merge pull request #409 from FungusGames/fix-line-endings

Fixed line endings on InvokeMethod classes
master
Chris Gregan 9 years ago
parent
commit
32ba45c880
  1. 832
      Assets/Fungus/Flowchart/Editor/InvokeMethodEditor.cs
  2. 478
      Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs
  3. 104
      Assets/Tests/Scripting/Scripting.unity

832
Assets/Fungus/Flowchart/Editor/InvokeMethodEditor.cs

@ -13,430 +13,430 @@ namespace Fungus
[CustomEditor(typeof(InvokeMethod))] [CustomEditor(typeof(InvokeMethod))]
public class InvokeMethodEditor : CommandEditor public class InvokeMethodEditor : CommandEditor
{ {
InvokeMethod targetMethod; InvokeMethod targetMethod;
public override void DrawCommandGUI() public override void DrawCommandGUI()
{ {
base.DrawCommandGUI(); base.DrawCommandGUI();
targetMethod = target as InvokeMethod; targetMethod = target as InvokeMethod;
if (targetMethod == null || targetMethod.targetObject == null) if (targetMethod == null || targetMethod.targetObject == null)
return; return;
SerializedObject objSerializedTarget = new SerializedObject(targetMethod); SerializedObject objSerializedTarget = new SerializedObject(targetMethod);
string component = ShowComponents(objSerializedTarget, targetMethod.targetObject); string component = ShowComponents(objSerializedTarget, targetMethod.targetObject);
// show component methods if selected // show component methods if selected
if (!string.IsNullOrEmpty(component)) if (!string.IsNullOrEmpty(component))
{ {
var method = ShowMethods(objSerializedTarget, targetMethod.targetObject, component); var method = ShowMethods(objSerializedTarget, targetMethod.targetObject, component);
// show method parameters if selected // show method parameters if selected
if (method != null) if (method != null)
{ {
objSerializedTarget.ApplyModifiedProperties(); objSerializedTarget.ApplyModifiedProperties();
ShowParameters(objSerializedTarget, targetMethod.targetObject, method); ShowParameters(objSerializedTarget, targetMethod.targetObject, method);
ShowReturnValue(objSerializedTarget, method); ShowReturnValue(objSerializedTarget, method);
} }
} }
} }
private string ShowComponents(SerializedObject objTarget, GameObject gameObject) private string ShowComponents(SerializedObject objTarget, GameObject gameObject)
{ {
var targetComponentAssemblyName = objTarget.FindProperty("targetComponentAssemblyName"); var targetComponentAssemblyName = objTarget.FindProperty("targetComponentAssemblyName");
var targetComponentFullname = objTarget.FindProperty("targetComponentFullname"); var targetComponentFullname = objTarget.FindProperty("targetComponentFullname");
var targetComponentText = objTarget.FindProperty("targetComponentText"); var targetComponentText = objTarget.FindProperty("targetComponentText");
var objComponents = gameObject.GetComponents<Component>(); var objComponents = gameObject.GetComponents<Component>();
var objTypesAssemblynames = (from objComp in objComponents select objComp.GetType().AssemblyQualifiedName).ToList(); var objTypesAssemblynames = (from objComp in objComponents select objComp.GetType().AssemblyQualifiedName).ToList();
var objTypesName = (from objComp in objComponents select objComp.GetType().Name).ToList(); var objTypesName = (from objComp in objComponents select objComp.GetType().Name).ToList();
int index = objTypesAssemblynames.IndexOf(targetComponentAssemblyName.stringValue); int index = objTypesAssemblynames.IndexOf(targetComponentAssemblyName.stringValue);
index = EditorGUILayout.Popup("Target Component", index, objTypesName.ToArray()); index = EditorGUILayout.Popup("Target Component", index, objTypesName.ToArray());
if (index != -1) if (index != -1)
{ {
targetComponentAssemblyName.stringValue = objTypesAssemblynames[index]; targetComponentAssemblyName.stringValue = objTypesAssemblynames[index];
targetComponentFullname.stringValue = objComponents.GetType().FullName; targetComponentFullname.stringValue = objComponents.GetType().FullName;
targetComponentText.stringValue = objTypesName[index]; targetComponentText.stringValue = objTypesName[index];
} }
else else
{ {
targetComponentAssemblyName.stringValue = null; targetComponentAssemblyName.stringValue = null;
} }
objTarget.ApplyModifiedProperties(); objTarget.ApplyModifiedProperties();
return targetComponentAssemblyName.stringValue; return targetComponentAssemblyName.stringValue;
} }
private MethodInfo ShowMethods(SerializedObject objTarget, GameObject gameObject, string component) private MethodInfo ShowMethods(SerializedObject objTarget, GameObject gameObject, string component)
{ {
MethodInfo result = null; MethodInfo result = null;
var targetMethodProp = objTarget.FindProperty("targetMethod"); var targetMethodProp = objTarget.FindProperty("targetMethod");
var targetMethodTextProp = objTarget.FindProperty("targetMethodText"); var targetMethodTextProp = objTarget.FindProperty("targetMethodText");
var methodParametersProp = objTarget.FindProperty("methodParameters"); var methodParametersProp = objTarget.FindProperty("methodParameters");
var showInheritedProp = objTarget.FindProperty("showInherited"); var showInheritedProp = objTarget.FindProperty("showInherited");
var saveReturnValueProp = objTarget.FindProperty("saveReturnValue"); var saveReturnValueProp = objTarget.FindProperty("saveReturnValue");
var returnValueKeyProp = objTarget.FindProperty("returnValueVariableKey"); var returnValueKeyProp = objTarget.FindProperty("returnValueVariableKey");
var objComponent = gameObject.GetComponent(ReflectionHelper.GetType(component)); var objComponent = gameObject.GetComponent(ReflectionHelper.GetType(component));
var bindingFlags = BindingFlags.Default | BindingFlags.Public | BindingFlags.Instance; var bindingFlags = BindingFlags.Default | BindingFlags.Public | BindingFlags.Instance;
if (!showInheritedProp.boolValue) if (!showInheritedProp.boolValue)
{ {
bindingFlags |= BindingFlags.DeclaredOnly; bindingFlags |= BindingFlags.DeclaredOnly;
} }
if (objComponent != null) if (objComponent != null)
{ {
var objMethods = objComponent.GetType().GetMethods(bindingFlags); var objMethods = objComponent.GetType().GetMethods(bindingFlags);
var methods = (from objMethod in objMethods where !objMethod.IsSpecialName select objMethod).ToList(); // filter out the getter/setter methods var methods = (from objMethod in objMethods where !objMethod.IsSpecialName select objMethod).ToList(); // filter out the getter/setter methods
var methodText = (from objMethod in methods select objMethod.Name + FormatParameters(objMethod.GetParameters()) + ": " + objMethod.ReturnType.Name).ToList(); var methodText = (from objMethod in methods select objMethod.Name + FormatParameters(objMethod.GetParameters()) + ": " + objMethod.ReturnType.Name).ToList();
int index = methodText.IndexOf(targetMethodTextProp.stringValue); int index = methodText.IndexOf(targetMethodTextProp.stringValue);
index = EditorGUILayout.Popup("Target Method", index, methodText.ToArray()); index = EditorGUILayout.Popup("Target Method", index, methodText.ToArray());
EditorGUILayout.PropertyField(showInheritedProp); EditorGUILayout.PropertyField(showInheritedProp);
if (index != -1) if (index != -1)
{ {
if (targetMethodTextProp.stringValue != methodText[index]) if (targetMethodTextProp.stringValue != methodText[index])
{ {
// reset // reset
methodParametersProp.ClearArray(); methodParametersProp.ClearArray();
methodParametersProp.arraySize = methods[index].GetParameters().Length; methodParametersProp.arraySize = methods[index].GetParameters().Length;
saveReturnValueProp.boolValue = false; saveReturnValueProp.boolValue = false;
returnValueKeyProp.stringValue = null; returnValueKeyProp.stringValue = null;
} }
targetMethodTextProp.stringValue = methodText[index]; targetMethodTextProp.stringValue = methodText[index];
targetMethodProp.stringValue = methods[index].Name; targetMethodProp.stringValue = methods[index].Name;
result = methods[index]; result = methods[index];
} }
else else
{ {
targetMethodTextProp.stringValue = null; targetMethodTextProp.stringValue = null;
targetMethodProp.stringValue = null; targetMethodProp.stringValue = null;
} }
objTarget.ApplyModifiedProperties(); objTarget.ApplyModifiedProperties();
} }
return result; return result;
} }
private void ShowParameters(SerializedObject objTarget, GameObject gameObject, MethodInfo method) private void ShowParameters(SerializedObject objTarget, GameObject gameObject, MethodInfo method)
{ {
var methodParametersProp = objTarget.FindProperty("methodParameters"); var methodParametersProp = objTarget.FindProperty("methodParameters");
var objParams = method.GetParameters(); var objParams = method.GetParameters();
if (objParams.Length > 0) if (objParams.Length > 0)
{ {
GUILayout.Space(20); GUILayout.Space(20);
EditorGUILayout.LabelField("Parameters", EditorStyles.boldLabel); EditorGUILayout.LabelField("Parameters", EditorStyles.boldLabel);
EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginVertical(EditorStyles.helpBox);
for (int i = 0; i < objParams.Length; i++) for (int i = 0; i < objParams.Length; i++)
{ {
var objParam = objParams[i]; var objParam = objParams[i];
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
string labelFormat = string.Format("{0}: {1}", objParam.ParameterType.Name, objParam.Name); string labelFormat = string.Format("{0}: {1}", objParam.ParameterType.Name, objParam.Name);
var objItemProp = methodParametersProp.GetArrayElementAtIndex(i); var objItemProp = methodParametersProp.GetArrayElementAtIndex(i);
var serObjValueProp = objItemProp.FindPropertyRelative("objValue"); var serObjValueProp = objItemProp.FindPropertyRelative("objValue");
var serVariableKeyProp = objItemProp.FindPropertyRelative("variableKey"); var serVariableKeyProp = objItemProp.FindPropertyRelative("variableKey");
var serValueTypeAssemblynameProp = serObjValueProp.FindPropertyRelative("typeAssemblyname"); var serValueTypeAssemblynameProp = serObjValueProp.FindPropertyRelative("typeAssemblyname");
var serValueTypeFullnameProp = serObjValueProp.FindPropertyRelative("typeFullname"); var serValueTypeFullnameProp = serObjValueProp.FindPropertyRelative("typeFullname");
serValueTypeAssemblynameProp.stringValue = objParam.ParameterType.AssemblyQualifiedName; serValueTypeAssemblynameProp.stringValue = objParam.ParameterType.AssemblyQualifiedName;
serValueTypeFullnameProp.stringValue = objParam.ParameterType.FullName; serValueTypeFullnameProp.stringValue = objParam.ParameterType.FullName;
bool isDrawn = true; bool isDrawn = true;
if (string.IsNullOrEmpty(serVariableKeyProp.stringValue)) if (string.IsNullOrEmpty(serVariableKeyProp.stringValue))
{ {
isDrawn = DrawTypedPropertyInput(labelFormat, serObjValueProp, objParam.ParameterType); isDrawn = DrawTypedPropertyInput(labelFormat, serObjValueProp, objParam.ParameterType);
} }
if (isDrawn) if (isDrawn)
{ {
var vars = GetFungusVariablesByType(targetMethod.GetFlowchart().variables, objParam.ParameterType); var vars = GetFungusVariablesByType(targetMethod.GetFlowchart().variables, objParam.ParameterType);
var values = new string[] { "<Value>" }; var values = new string[] { "<Value>" };
var displayValue = values.Concat(vars).ToList(); var displayValue = values.Concat(vars).ToList();
int index = displayValue.IndexOf(serVariableKeyProp.stringValue); int index = displayValue.IndexOf(serVariableKeyProp.stringValue);
if (index == -1) if (index == -1)
{ {
index = 0; index = 0;
} }
if (string.IsNullOrEmpty(serVariableKeyProp.stringValue)) if (string.IsNullOrEmpty(serVariableKeyProp.stringValue))
{ {
index = EditorGUILayout.Popup(index, displayValue.ToArray(), GUILayout.MaxWidth(80)); index = EditorGUILayout.Popup(index, displayValue.ToArray(), GUILayout.MaxWidth(80));
} }
else else
{ {
index = EditorGUILayout.Popup(labelFormat, index, displayValue.ToArray()); index = EditorGUILayout.Popup(labelFormat, index, displayValue.ToArray());
} }
if (index > 0) if (index > 0)
{ {
serVariableKeyProp.stringValue = displayValue[index]; serVariableKeyProp.stringValue = displayValue[index];
} }
else else
{ {
serVariableKeyProp.stringValue = null; serVariableKeyProp.stringValue = null;
} }
} }
else else
{ {
var style = EditorStyles.label; var style = EditorStyles.label;
var prevColor = style.normal.textColor; var prevColor = style.normal.textColor;
style.normal.textColor = Color.red; style.normal.textColor = Color.red;
EditorGUILayout.LabelField(new GUIContent(objParam.ParameterType.Name + " cannot be drawn, don´t use this method in the flowchart."), style); EditorGUILayout.LabelField(new GUIContent(objParam.ParameterType.Name + " cannot be drawn, don´t use this method in the flowchart."), style);
style.normal.textColor = prevColor; style.normal.textColor = prevColor;
} }
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
} }
EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical();
objTarget.ApplyModifiedProperties(); objTarget.ApplyModifiedProperties();
} }
} }
private void ShowReturnValue(SerializedObject objTarget, MethodInfo method) private void ShowReturnValue(SerializedObject objTarget, MethodInfo method)
{ {
var saveReturnValueProp = objTarget.FindProperty("saveReturnValue"); var saveReturnValueProp = objTarget.FindProperty("saveReturnValue");
var returnValueKeyProp = objTarget.FindProperty("returnValueVariableKey"); var returnValueKeyProp = objTarget.FindProperty("returnValueVariableKey");
var returnValueTypeProp = objTarget.FindProperty("returnValueType"); var returnValueTypeProp = objTarget.FindProperty("returnValueType");
var callModeProp = objTarget.FindProperty("callMode"); var callModeProp = objTarget.FindProperty("callMode");
returnValueTypeProp.stringValue = method.ReturnType.FullName; returnValueTypeProp.stringValue = method.ReturnType.FullName;
if (method.ReturnType == typeof(IEnumerator)) if (method.ReturnType == typeof(IEnumerator))
{ {
GUILayout.Space(20); GUILayout.Space(20);
EditorGUILayout.PropertyField(callModeProp); EditorGUILayout.PropertyField(callModeProp);
} }
else if (method.ReturnType != typeof(void)) else if (method.ReturnType != typeof(void))
{ {
GUILayout.Space(20); GUILayout.Space(20);
EditorGUILayout.LabelField("Return Value", EditorStyles.boldLabel); EditorGUILayout.LabelField("Return Value", EditorStyles.boldLabel);
EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginVertical(EditorStyles.helpBox);
saveReturnValueProp.boolValue = EditorGUILayout.Toggle("Save return value", saveReturnValueProp.boolValue); saveReturnValueProp.boolValue = EditorGUILayout.Toggle("Save return value", saveReturnValueProp.boolValue);
if (saveReturnValueProp.boolValue) if (saveReturnValueProp.boolValue)
{ {
var vars = GetFungusVariablesByType(targetMethod.GetFlowchart().variables, method.ReturnType).ToList(); var vars = GetFungusVariablesByType(targetMethod.GetFlowchart().variables, method.ReturnType).ToList();
int index = vars.IndexOf(returnValueKeyProp.stringValue); int index = vars.IndexOf(returnValueKeyProp.stringValue);
index = EditorGUILayout.Popup(method.ReturnType.Name, index, vars.ToArray()); index = EditorGUILayout.Popup(method.ReturnType.Name, index, vars.ToArray());
if (index != -1) if (index != -1)
{ {
returnValueKeyProp.stringValue = vars[index]; returnValueKeyProp.stringValue = vars[index];
} }
} }
EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical();
} }
else else
{ {
saveReturnValueProp.boolValue = false; saveReturnValueProp.boolValue = false;
} }
objTarget.ApplyModifiedProperties(); objTarget.ApplyModifiedProperties();
} }
private bool DrawTypedPropertyInput(string label, SerializedProperty objProperty, Type type) private bool DrawTypedPropertyInput(string label, SerializedProperty objProperty, Type type)
{ {
SerializedProperty objectValue = null; SerializedProperty objectValue = null;
if (type == typeof(int)) if (type == typeof(int))
{ {
objectValue = objProperty.FindPropertyRelative("intValue"); objectValue = objProperty.FindPropertyRelative("intValue");
objectValue.intValue = EditorGUILayout.IntField(new GUIContent(label), objectValue.intValue); objectValue.intValue = EditorGUILayout.IntField(new GUIContent(label), objectValue.intValue);
return true; return true;
} }
else if (type == typeof(bool)) else if (type == typeof(bool))
{ {
objectValue = objProperty.FindPropertyRelative("boolValue"); objectValue = objProperty.FindPropertyRelative("boolValue");
objectValue.boolValue = EditorGUILayout.Toggle(new GUIContent(label), objectValue.boolValue); objectValue.boolValue = EditorGUILayout.Toggle(new GUIContent(label), objectValue.boolValue);
return true; return true;
} }
else if (type == typeof(float)) else if (type == typeof(float))
{ {
objectValue = objProperty.FindPropertyRelative("floatValue"); objectValue = objProperty.FindPropertyRelative("floatValue");
objectValue.floatValue = EditorGUILayout.FloatField(new GUIContent(label), objectValue.floatValue); objectValue.floatValue = EditorGUILayout.FloatField(new GUIContent(label), objectValue.floatValue);
return true; return true;
} }
else if (type == typeof(string)) else if (type == typeof(string))
{ {
objectValue = objProperty.FindPropertyRelative("stringValue"); objectValue = objProperty.FindPropertyRelative("stringValue");
objectValue.stringValue = EditorGUILayout.TextField(new GUIContent(label), objectValue.stringValue); objectValue.stringValue = EditorGUILayout.TextField(new GUIContent(label), objectValue.stringValue);
return true; return true;
} }
else if (type == typeof(Color)) else if (type == typeof(Color))
{ {
objectValue = objProperty.FindPropertyRelative("colorValue"); objectValue = objProperty.FindPropertyRelative("colorValue");
objectValue.colorValue = EditorGUILayout.ColorField(new GUIContent(label), objectValue.colorValue); objectValue.colorValue = EditorGUILayout.ColorField(new GUIContent(label), objectValue.colorValue);
return true; return true;
} }
else if (type == typeof(UnityEngine.GameObject)) else if (type == typeof(UnityEngine.GameObject))
{ {
objectValue = objProperty.FindPropertyRelative("gameObjectValue"); objectValue = objProperty.FindPropertyRelative("gameObjectValue");
objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.GameObject), true); objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.GameObject), true);
return true; return true;
} }
else if (type == typeof(UnityEngine.Material)) else if (type == typeof(UnityEngine.Material))
{ {
objectValue = objProperty.FindPropertyRelative("materialValue"); objectValue = objProperty.FindPropertyRelative("materialValue");
objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Material), true); objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Material), true);
return true; return true;
} }
else if (type == typeof(UnityEngine.Sprite)) else if (type == typeof(UnityEngine.Sprite))
{ {
objectValue = objProperty.FindPropertyRelative("spriteValue"); objectValue = objProperty.FindPropertyRelative("spriteValue");
objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Sprite), true); objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Sprite), true);
return true; return true;
} }
else if (type == typeof(UnityEngine.Texture)) else if (type == typeof(UnityEngine.Texture))
{ {
objectValue = objProperty.FindPropertyRelative("textureValue"); objectValue = objProperty.FindPropertyRelative("textureValue");
objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Texture), true); objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, typeof(UnityEngine.Texture), true);
return true; return true;
} }
else if (type == typeof(UnityEngine.Vector2)) else if (type == typeof(UnityEngine.Vector2))
{ {
objectValue = objProperty.FindPropertyRelative("vector2Value"); objectValue = objProperty.FindPropertyRelative("vector2Value");
objectValue.vector2Value = EditorGUILayout.Vector2Field(new GUIContent(label), objectValue.vector2Value); objectValue.vector2Value = EditorGUILayout.Vector2Field(new GUIContent(label), objectValue.vector2Value);
return true; return true;
} }
else if (type == typeof(UnityEngine.Vector3)) else if (type == typeof(UnityEngine.Vector3))
{ {
objectValue = objProperty.FindPropertyRelative("vector3Value"); objectValue = objProperty.FindPropertyRelative("vector3Value");
objectValue.vector3Value = EditorGUILayout.Vector3Field(new GUIContent(label), objectValue.vector3Value); objectValue.vector3Value = EditorGUILayout.Vector3Field(new GUIContent(label), objectValue.vector3Value);
return true; return true;
} }
else if (type.IsSubclassOf(typeof(UnityEngine.Object))) else if (type.IsSubclassOf(typeof(UnityEngine.Object)))
{ {
objectValue = objProperty.FindPropertyRelative("objectValue"); objectValue = objProperty.FindPropertyRelative("objectValue");
objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, type, true); objectValue.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent(label), objectValue.objectReferenceValue, type, true);
return true; return true;
} }
else if (type.IsEnum) else if (type.IsEnum)
{ {
var enumNames = Enum.GetNames(type); var enumNames = Enum.GetNames(type);
objectValue = objProperty.FindPropertyRelative("intValue"); objectValue = objProperty.FindPropertyRelative("intValue");
objectValue.intValue = EditorGUILayout.Popup(label, objectValue.intValue, enumNames); objectValue.intValue = EditorGUILayout.Popup(label, objectValue.intValue, enumNames);
return true; return true;
} }
return false; return false;
} }
private string[] GetFungusVariablesByType(List<Variable> variables, Type type) private string[] GetFungusVariablesByType(List<Variable> variables, Type type)
{ {
string[] result = new string[0]; string[] result = new string[0];
if (type == typeof(int)) if (type == typeof(int))
{ {
result = (from v in variables where v.GetType() == typeof(IntegerVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(IntegerVariable) select v.key).ToArray();
} }
else if (type == typeof(bool)) else if (type == typeof(bool))
{ {
result = (from v in variables where v.GetType() == typeof(BooleanVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(BooleanVariable) select v.key).ToArray();
} }
else if (type == typeof(float)) else if (type == typeof(float))
{ {
result = (from v in variables where v.GetType() == typeof(FloatVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(FloatVariable) select v.key).ToArray();
} }
else if (type == typeof(string)) else if (type == typeof(string))
{ {
result = (from v in variables where v.GetType() == typeof(StringVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(StringVariable) select v.key).ToArray();
} }
else if (type == typeof(Color)) else if (type == typeof(Color))
{ {
result = (from v in variables where v.GetType() == typeof(ColorVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(ColorVariable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.GameObject)) else if (type == typeof(UnityEngine.GameObject))
{ {
result = (from v in variables where v.GetType() == typeof(GameObjectVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(GameObjectVariable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.Material)) else if (type == typeof(UnityEngine.Material))
{ {
result = (from v in variables where v.GetType() == typeof(MaterialVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(MaterialVariable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.Sprite)) else if (type == typeof(UnityEngine.Sprite))
{ {
result = (from v in variables where v.GetType() == typeof(SpriteVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(SpriteVariable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.Texture)) else if (type == typeof(UnityEngine.Texture))
{ {
result = (from v in variables where v.GetType() == typeof(TextureVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(TextureVariable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.Vector2)) else if (type == typeof(UnityEngine.Vector2))
{ {
result = (from v in variables where v.GetType() == typeof(Vector2Variable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(Vector2Variable) select v.key).ToArray();
} }
else if (type == typeof(UnityEngine.Vector3)) else if (type == typeof(UnityEngine.Vector3))
{ {
result = (from v in variables where v.GetType() == typeof(Vector3Variable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(Vector3Variable) select v.key).ToArray();
} }
else if (type.IsSubclassOf(typeof(UnityEngine.Object))) else if (type.IsSubclassOf(typeof(UnityEngine.Object)))
{ {
result = (from v in variables where v.GetType() == typeof(ObjectVariable) select v.key).ToArray(); result = (from v in variables where v.GetType() == typeof(ObjectVariable) select v.key).ToArray();
} }
return result; return result;
} }
private string FormatParameters(ParameterInfo[] paramInfo) private string FormatParameters(ParameterInfo[] paramInfo)
{ {
string result = " ("; string result = " (";
for (int i = 0; i < paramInfo.Length; i++) for (int i = 0; i < paramInfo.Length; i++)
{ {
var pi = paramInfo[i]; var pi = paramInfo[i];
result += pi.ParameterType.Name; // " arg" + (i + 1); result += pi.ParameterType.Name; // " arg" + (i + 1);
if (i < paramInfo.Length - 1) if (i < paramInfo.Length - 1)
{ {
result += ", "; result += ", ";
} }
} }
return result + ")"; return result + ")";
} }
private object GetDefaultValue(Type t) private object GetDefaultValue(Type t)
{ {
if (t.IsValueType) if (t.IsValueType)
return Activator.CreateInstance(t); return Activator.CreateInstance(t);
return null; return null;
} }
} }
} }

478
Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs

@ -11,64 +11,64 @@ namespace Fungus
{ {
[CommandInfo("Scripting", [CommandInfo("Scripting",
"Invoke Method", "Invoke Method",
"Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable.")] "Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable.")]
public class InvokeMethod : Command public class InvokeMethod : Command
{ {
[Tooltip("GameObject containing the component method to be invoked")] [Tooltip("GameObject containing the component method to be invoked")]
public GameObject targetObject; public GameObject targetObject;
[HideInInspector] [HideInInspector]
[Tooltip("Name of assembly containing the target component")] [Tooltip("Name of assembly containing the target component")]
public string targetComponentAssemblyName; public string targetComponentAssemblyName;
[HideInInspector] [HideInInspector]
[Tooltip("Full name of the target component")] [Tooltip("Full name of the target component")]
public string targetComponentFullname; public string targetComponentFullname;
[HideInInspector] [HideInInspector]
[Tooltip("Display name of the target component")] [Tooltip("Display name of the target component")]
public string targetComponentText; public string targetComponentText;
[HideInInspector] [HideInInspector]
[Tooltip("Name of target method to invoke on the target component")] [Tooltip("Name of target method to invoke on the target component")]
public string targetMethod; public string targetMethod;
[HideInInspector] [HideInInspector]
[Tooltip("Display name of target method to invoke on the target component")] [Tooltip("Display name of target method to invoke on the target component")]
public string targetMethodText; public string targetMethodText;
[HideInInspector] [HideInInspector]
[Tooltip("List of parameters to pass to the invoked method")] [Tooltip("List of parameters to pass to the invoked method")]
public InvokeMethodParameter[] methodParameters; public InvokeMethodParameter[] methodParameters;
[HideInInspector] [HideInInspector]
[Tooltip("If true, store the return value in a flowchart variable of the same type.")] [Tooltip("If true, store the return value in a flowchart variable of the same type.")]
public bool saveReturnValue; public bool saveReturnValue;
[HideInInspector] [HideInInspector]
[Tooltip("Name of Fungus variable to store the return value in")] [Tooltip("Name of Fungus variable to store the return value in")]
public string returnValueVariableKey; public string returnValueVariableKey;
[HideInInspector] [HideInInspector]
[Tooltip("The type of the return value")] [Tooltip("The type of the return value")]
public string returnValueType; public string returnValueType;
[HideInInspector] [HideInInspector]
[Tooltip("If true, list all inherited methods for the component")] [Tooltip("If true, list all inherited methods for the component")]
public bool showInherited; public bool showInherited;
[HideInInspector] [HideInInspector]
[Tooltip("The coroutine call behavior for methods that return IEnumerator")] [Tooltip("The coroutine call behavior for methods that return IEnumerator")]
public Fungus.Call.CallMode callMode; public Fungus.Call.CallMode callMode;
protected Type componentType; protected Type componentType;
protected Component objComponent; protected Component objComponent;
protected Type[] parameterTypes = null; protected Type[] parameterTypes = null;
protected MethodInfo objMethod; protected MethodInfo objMethod;
protected virtual void Awake() protected virtual void Awake()
{ {
if (componentType == null) if (componentType == null)
{ {
componentType = ReflectionHelper.GetType(targetComponentAssemblyName); componentType = ReflectionHelper.GetType(targetComponentAssemblyName);
@ -88,10 +88,10 @@ namespace Fungus
{ {
objMethod = UnityEvent.GetValidMethodInfo(objComponent, targetMethod, parameterTypes); objMethod = UnityEvent.GetValidMethodInfo(objComponent, targetMethod, parameterTypes);
} }
} }
public override void OnEnter() public override void OnEnter()
{ {
try try
{ {
if (targetObject == null || string.IsNullOrEmpty(targetComponentAssemblyName) || string.IsNullOrEmpty(targetMethod)) if (targetObject == null || string.IsNullOrEmpty(targetComponentAssemblyName) || string.IsNullOrEmpty(targetMethod))
@ -121,7 +121,7 @@ namespace Fungus
} }
else if(callMode == Call.CallMode.Stop) else if(callMode == Call.CallMode.Stop)
{ {
StopParentBlock(); StopParentBlock();
} }
} }
} }
@ -131,259 +131,259 @@ namespace Fungus
} }
} }
protected virtual IEnumerator ExecuteCoroutine() protected virtual IEnumerator ExecuteCoroutine()
{ {
yield return StartCoroutine((IEnumerator)objMethod.Invoke(objComponent, GetParameterValues())); yield return StartCoroutine((IEnumerator)objMethod.Invoke(objComponent, GetParameterValues()));
if (callMode == Call.CallMode.WaitUntilFinished) if (callMode == Call.CallMode.WaitUntilFinished)
{ {
Continue(); Continue();
} }
} }
public override Color GetButtonColor() public override Color GetButtonColor()
{ {
return new Color32(235, 191, 217, 255); return new Color32(235, 191, 217, 255);
} }
public override string GetSummary() public override string GetSummary()
{ {
if (targetObject == null) if (targetObject == null)
{ {
return "Error: targetObject is not assigned"; return "Error: targetObject is not assigned";
} }
return targetObject.name + "." + targetComponentText + "." + targetMethodText; return targetObject.name + "." + targetComponentText + "." + targetMethodText;
} }
protected System.Type[] GetParameterTypes() protected System.Type[] GetParameterTypes()
{ {
System.Type[] types = new System.Type[methodParameters.Length]; System.Type[] types = new System.Type[methodParameters.Length];
for (int i = 0; i < methodParameters.Length; i++) for (int i = 0; i < methodParameters.Length; i++)
{ {
var item = methodParameters[i]; var item = methodParameters[i];
var objType = ReflectionHelper.GetType(item.objValue.typeAssemblyname); var objType = ReflectionHelper.GetType(item.objValue.typeAssemblyname);
types[i] = objType; types[i] = objType;
} }
return types; return types;
} }
protected object[] GetParameterValues() protected object[] GetParameterValues()
{ {
object[] values = new object[methodParameters.Length]; object[] values = new object[methodParameters.Length];
var flowChart = GetFlowchart(); var flowChart = GetFlowchart();
for (int i = 0; i < methodParameters.Length; i++) for (int i = 0; i < methodParameters.Length; i++)
{ {
var item = methodParameters[i]; var item = methodParameters[i];
if (string.IsNullOrEmpty(item.variableKey)) if (string.IsNullOrEmpty(item.variableKey))
{ {
values[i] = item.objValue.GetValue(); values[i] = item.objValue.GetValue();
} }
else else
{ {
object objValue = null; object objValue = null;
switch (item.objValue.typeFullname) switch (item.objValue.typeFullname)
{ {
case "System.Int32": case "System.Int32":
objValue = flowChart.GetIntegerVariable(item.variableKey); objValue = flowChart.GetIntegerVariable(item.variableKey);
break; break;
case "System.Boolean": case "System.Boolean":
objValue = flowChart.GetBooleanVariable(item.variableKey); objValue = flowChart.GetBooleanVariable(item.variableKey);
break; break;
case "System.Single": case "System.Single":
objValue = flowChart.GetFloatVariable(item.variableKey); objValue = flowChart.GetFloatVariable(item.variableKey);
break; break;
case "System.String": case "System.String":
objValue = flowChart.GetStringVariable(item.variableKey); objValue = flowChart.GetStringVariable(item.variableKey);
break; break;
case "UnityEngine.Color": case "UnityEngine.Color":
var color = flowChart.GetVariable<ColorVariable>(item.variableKey); var color = flowChart.GetVariable<ColorVariable>(item.variableKey);
if (color != null) if (color != null)
objValue = color.value; objValue = color.value;
break; break;
case "UnityEngine.GameObject": case "UnityEngine.GameObject":
var gameObject = flowChart.GetVariable<GameObjectVariable>(item.variableKey); var gameObject = flowChart.GetVariable<GameObjectVariable>(item.variableKey);
if (gameObject != null) if (gameObject != null)
objValue = gameObject.value; objValue = gameObject.value;
break; break;
case "UnityEngine.Material": case "UnityEngine.Material":
var material = flowChart.GetVariable<MaterialVariable>(item.variableKey); var material = flowChart.GetVariable<MaterialVariable>(item.variableKey);
if (material != null) if (material != null)
objValue = material.value; objValue = material.value;
break; break;
case "UnityEngine.Sprite": case "UnityEngine.Sprite":
var sprite = flowChart.GetVariable<SpriteVariable>(item.variableKey); var sprite = flowChart.GetVariable<SpriteVariable>(item.variableKey);
if (sprite != null) if (sprite != null)
objValue = sprite.value; objValue = sprite.value;
break; break;
case "UnityEngine.Texture": case "UnityEngine.Texture":
var texture = flowChart.GetVariable<TextureVariable>(item.variableKey); var texture = flowChart.GetVariable<TextureVariable>(item.variableKey);
if (texture != null) if (texture != null)
objValue = texture.value; objValue = texture.value;
break; break;
case "UnityEngine.Vector2": case "UnityEngine.Vector2":
var vector2 = flowChart.GetVariable<Vector2Variable>(item.variableKey); var vector2 = flowChart.GetVariable<Vector2Variable>(item.variableKey);
if (vector2 != null) if (vector2 != null)
objValue = vector2.value; objValue = vector2.value;
break; break;
case "UnityEngine.Vector3": case "UnityEngine.Vector3":
var vector3 = flowChart.GetVariable<Vector3Variable>(item.variableKey); var vector3 = flowChart.GetVariable<Vector3Variable>(item.variableKey);
if (vector3 != null) if (vector3 != null)
objValue = vector3.value; objValue = vector3.value;
break; break;
default: default:
var obj = flowChart.GetVariable<ObjectVariable>(item.variableKey); var obj = flowChart.GetVariable<ObjectVariable>(item.variableKey);
if (obj != null) if (obj != null)
objValue = obj.value; objValue = obj.value;
break; break;
} }
values[i] = objValue; values[i] = objValue;
} }
} }
return values; return values;
} }
protected void SetVariable(string key, object value, string returnType) protected void SetVariable(string key, object value, string returnType)
{ {
var flowChart = GetFlowchart(); var flowChart = GetFlowchart();
switch (returnType) switch (returnType)
{ {
case "System.Int32": case "System.Int32":
flowChart.SetIntegerVariable(key, (int)value); flowChart.SetIntegerVariable(key, (int)value);
break; break;
case "System.Boolean": case "System.Boolean":
flowChart.SetBooleanVariable(key, (bool)value); flowChart.SetBooleanVariable(key, (bool)value);
break; break;
case "System.Single": case "System.Single":
flowChart.SetFloatVariable(key, (float)value); flowChart.SetFloatVariable(key, (float)value);
break; break;
case "System.String": case "System.String":
flowChart.SetStringVariable(key, (string)value); flowChart.SetStringVariable(key, (string)value);
break; break;
case "UnityEngine.Color": case "UnityEngine.Color":
flowChart.GetVariable<ColorVariable>(key).value = (UnityEngine.Color)value; flowChart.GetVariable<ColorVariable>(key).value = (UnityEngine.Color)value;
break; break;
case "UnityEngine.GameObject": case "UnityEngine.GameObject":
flowChart.GetVariable<GameObjectVariable>(key).value = (UnityEngine.GameObject)value; flowChart.GetVariable<GameObjectVariable>(key).value = (UnityEngine.GameObject)value;
break; break;
case "UnityEngine.Material": case "UnityEngine.Material":
flowChart.GetVariable<MaterialVariable>(key).value = (UnityEngine.Material)value; flowChart.GetVariable<MaterialVariable>(key).value = (UnityEngine.Material)value;
break; break;
case "UnityEngine.Sprite": case "UnityEngine.Sprite":
flowChart.GetVariable<SpriteVariable>(key).value = (UnityEngine.Sprite)value; flowChart.GetVariable<SpriteVariable>(key).value = (UnityEngine.Sprite)value;
break; break;
case "UnityEngine.Texture": case "UnityEngine.Texture":
flowChart.GetVariable<TextureVariable>(key).value = (UnityEngine.Texture)value; flowChart.GetVariable<TextureVariable>(key).value = (UnityEngine.Texture)value;
break; break;
case "UnityEngine.Vector2": case "UnityEngine.Vector2":
flowChart.GetVariable<Vector2Variable>(key).value = (UnityEngine.Vector2)value; flowChart.GetVariable<Vector2Variable>(key).value = (UnityEngine.Vector2)value;
break; break;
case "UnityEngine.Vector3": case "UnityEngine.Vector3":
flowChart.GetVariable<Vector3Variable>(key).value = (UnityEngine.Vector3)value; flowChart.GetVariable<Vector3Variable>(key).value = (UnityEngine.Vector3)value;
break; break;
default: default:
flowChart.GetVariable<ObjectVariable>(key).value = (UnityEngine.Object)value; flowChart.GetVariable<ObjectVariable>(key).value = (UnityEngine.Object)value;
break; break;
} }
} }
} }
[System.Serializable] [System.Serializable]
public class InvokeMethodParameter public class InvokeMethodParameter
{ {
[SerializeField] [SerializeField]
public ObjectValue objValue; public ObjectValue objValue;
[SerializeField] [SerializeField]
public string variableKey; public string variableKey;
} }
[System.Serializable] [System.Serializable]
public class ObjectValue public class ObjectValue
{ {
public string typeAssemblyname; public string typeAssemblyname;
public string typeFullname; public string typeFullname;
public int intValue; public int intValue;
public bool boolValue; public bool boolValue;
public float floatValue; public float floatValue;
public string stringValue; public string stringValue;
public Color colorValue; public Color colorValue;
public GameObject gameObjectValue; public GameObject gameObjectValue;
public Material materialValue; public Material materialValue;
public UnityEngine.Object objectValue; public UnityEngine.Object objectValue;
public Sprite spriteValue; public Sprite spriteValue;
public Texture textureValue; public Texture textureValue;
public Vector2 vector2Value; public Vector2 vector2Value;
public Vector3 vector3Value; public Vector3 vector3Value;
public object GetValue() public object GetValue()
{ {
switch (typeFullname) switch (typeFullname)
{ {
case "System.Int32": case "System.Int32":
return intValue; return intValue;
case "System.Boolean": case "System.Boolean":
return boolValue; return boolValue;
case "System.Single": case "System.Single":
return floatValue; return floatValue;
case "System.String": case "System.String":
return stringValue; return stringValue;
case "UnityEngine.Color": case "UnityEngine.Color":
return colorValue; return colorValue;
case "UnityEngine.GameObject": case "UnityEngine.GameObject":
return gameObjectValue; return gameObjectValue;
case "UnityEngine.Material": case "UnityEngine.Material":
return materialValue; return materialValue;
case "UnityEngine.Sprite": case "UnityEngine.Sprite":
return spriteValue; return spriteValue;
case "UnityEngine.Texture": case "UnityEngine.Texture":
return textureValue; return textureValue;
case "UnityEngine.Vector2": case "UnityEngine.Vector2":
return vector2Value; return vector2Value;
case "UnityEngine.Vector3": case "UnityEngine.Vector3":
return vector3Value; return vector3Value;
default: default:
var objType = ReflectionHelper.GetType(typeAssemblyname); var objType = ReflectionHelper.GetType(typeAssemblyname);
if (objType.IsSubclassOf(typeof(UnityEngine.Object))) if (objType.IsSubclassOf(typeof(UnityEngine.Object)))
{ {
return objectValue; return objectValue;
} }
else if (objType.IsEnum()) else if (objType.IsEnum())
return System.Enum.ToObject(objType, intValue); return System.Enum.ToObject(objType, intValue);
break; break;
} }
return null; return null;
} }
} }
public static class ReflectionHelper public static class ReflectionHelper
{ {
static Dictionary<string, System.Type> types = new Dictionary<string, System.Type>(); static Dictionary<string, System.Type> types = new Dictionary<string, System.Type>();
public static System.Type GetType(string typeName) public static System.Type GetType(string typeName)
{ {
if (types.ContainsKey(typeName)) if (types.ContainsKey(typeName))
return types[typeName]; return types[typeName];
types[typeName] = System.Type.GetType(typeName); types[typeName] = System.Type.GetType(typeName);
return types[typeName]; return types[typeName];
} }
} }
} }

104
Assets/Tests/Scripting/Scripting.unity

@ -196,7 +196,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -209,8 +209,7 @@ MonoBehaviour:
width: 1114 width: 1114
height: 859 height: 859
selectedBlock: {fileID: 115525222} selectedBlock: {fileID: 115525222}
selectedCommands: selectedCommands: []
- {fileID: 115525219}
variables: [] variables: []
description: description:
stepPause: 0 stepPause: 0
@ -279,7 +278,10 @@ MonoBehaviour:
itemId: 1 itemId: 1
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 3 _duration:
floatRef: {fileID: 0}
floatVal: 3
durationOLD: 0
--- !u!114 &169310213 --- !u!114 &169310213
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 2 m_ObjectHideFlags: 2
@ -330,7 +332,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -433,7 +435,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -967,7 +969,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -1073,7 +1075,10 @@ MonoBehaviour:
itemId: 3 itemId: 3
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 1 _duration:
floatRef: {fileID: 0}
floatVal: 1
durationOLD: 0
--- !u!114 &575910003 --- !u!114 &575910003
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 2 m_ObjectHideFlags: 2
@ -1134,6 +1139,7 @@ MonoBehaviour:
extendPrevious: 0 extendPrevious: 0
fadeWhenDone: 1 fadeWhenDone: 1
waitForClick: 1 waitForClick: 1
stopVoiceover: 1
setSayDialog: {fileID: 0} setSayDialog: {fileID: 0}
--- !u!114 &575910006 --- !u!114 &575910006
MonoBehaviour: MonoBehaviour:
@ -1185,7 +1191,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -1310,7 +1316,10 @@ MonoBehaviour:
itemId: 3 itemId: 3
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 1 _duration:
floatRef: {fileID: 0}
floatVal: 1
durationOLD: 0
--- !u!114 &590474777 --- !u!114 &590474777
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 2 m_ObjectHideFlags: 2
@ -1398,7 +1407,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -1530,7 +1539,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -1595,7 +1604,10 @@ MonoBehaviour:
itemId: 3 itemId: 3
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 1 _duration:
floatRef: {fileID: 0}
floatVal: 1
durationOLD: 0
--- !u!114 &636123612 --- !u!114 &636123612
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 2 m_ObjectHideFlags: 2
@ -1708,7 +1720,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
selectedFlowchart: {fileID: 115525223} selectedFlowchart: {fileID: 1618689129}
--- !u!4 &646902075 --- !u!4 &646902075
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -1736,7 +1748,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!114 &676156675 --- !u!114 &676156675
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2320,7 +2332,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
@ -2334,7 +2346,7 @@ MonoBehaviour:
height: 873 height: 873
selectedBlock: {fileID: 1618689131} selectedBlock: {fileID: 1618689131}
selectedCommands: selectedCommands:
- {fileID: 1618689152} - {fileID: 1618689150}
variables: variables:
- {fileID: 1618689138} - {fileID: 1618689138}
- {fileID: 1618689141} - {fileID: 1618689141}
@ -2719,7 +2731,7 @@ MonoBehaviour:
callMode: 0 callMode: 0
--- !u!114 &1618689140 --- !u!114 &1618689140
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -2858,7 +2870,7 @@ MonoBehaviour:
callMode: 0 callMode: 0
--- !u!114 &1618689147 --- !u!114 &1618689147
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -2884,7 +2896,7 @@ MonoBehaviour:
- {fileID: 1618689148} - {fileID: 1618689148}
--- !u!114 &1618689148 --- !u!114 &1618689148
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -2948,7 +2960,7 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null Culture=neutral, PublicKeyToken=null
--- !u!114 &1618689149 --- !u!114 &1618689149
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -2975,7 +2987,7 @@ MonoBehaviour:
callMode: 0 callMode: 0
--- !u!114 &1618689150 --- !u!114 &1618689150
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -2993,7 +3005,7 @@ MonoBehaviour:
targetComponentFullname: UnityEngine.Component[] targetComponentFullname: UnityEngine.Component[]
targetComponentText: Flowchart targetComponentText: Flowchart
targetMethod: ExecuteBlock targetMethod: ExecuteBlock
targetMethodText: 'ExecuteBlock (String): Void' targetMethodText: 'ExecuteBlock (String, Int32, Action): Void'
methodParameters: methodParameters:
- objValue: - objValue:
typeAssemblyname: System.String, mscorlib, Version=2.0.0.0, Culture=neutral, typeAssemblyname: System.String, mscorlib, Version=2.0.0.0, Culture=neutral,
@ -3012,6 +3024,40 @@ MonoBehaviour:
vector2Value: {x: 0, y: 0} vector2Value: {x: 0, y: 0}
vector3Value: {x: 0, y: 0, z: 0} vector3Value: {x: 0, y: 0, z: 0}
variableKey: variableKey:
- objValue:
typeAssemblyname: System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
typeFullname: System.Int32
intValue: 0
boolValue: 0
floatValue: 0
stringValue:
colorValue: {r: 0, g: 0, b: 0, a: 0}
gameObjectValue: {fileID: 0}
materialValue: {fileID: 0}
objectValue: {fileID: 0}
spriteValue: {fileID: 0}
textureValue: {fileID: 0}
vector2Value: {x: 0, y: 0}
vector3Value: {x: 0, y: 0, z: 0}
variableKey:
- objValue:
typeAssemblyname: System.Action, System.Core, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
typeFullname: System.Action
intValue: 0
boolValue: 0
floatValue: 0
stringValue:
colorValue: {r: 0, g: 0, b: 0, a: 0}
gameObjectValue: {fileID: 0}
materialValue: {fileID: 0}
objectValue: {fileID: 0}
spriteValue: {fileID: 0}
textureValue: {fileID: 0}
vector2Value: {x: 0, y: 0}
vector3Value: {x: 0, y: 0, z: 0}
variableKey:
saveReturnValue: 0 saveReturnValue: 0
returnValueVariableKey: returnValueVariableKey:
returnValueType: System.Void returnValueType: System.Void
@ -3019,7 +3065,7 @@ MonoBehaviour:
callMode: 0 callMode: 0
--- !u!114 &1618689151 --- !u!114 &1618689151
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -3031,10 +3077,13 @@ MonoBehaviour:
itemId: 16 itemId: 16
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 1 _duration:
floatRef: {fileID: 0}
floatVal: 1
durationOLD: 0
--- !u!114 &1618689152 --- !u!114 &1618689152
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128} m_GameObject: {fileID: 1618689128}
@ -3314,6 +3363,7 @@ Canvas:
m_ReceivesEvents: 1 m_ReceivesEvents: 1
m_OverrideSorting: 0 m_OverrideSorting: 0
m_OverridePixelPerfect: 0 m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_TargetDisplay: 0 m_TargetDisplay: 0
@ -3438,7 +3488,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
version: 1.0 version: 1
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1

Loading…
Cancel
Save