Browse Source

Explicitly register types via text file list

master
chrisgregan 9 years ago
parent
commit
887bc54e92
  1. 4
      Assets/Fungus/FungusScript/Resources/Prefabs/FungusScript.prefab
  2. 9
      Assets/Fungus/FungusScript/Resources/Types.meta
  3. 2
      Assets/Fungus/FungusScript/Resources/Types/ExtensionTypes.txt
  4. 8
      Assets/Fungus/FungusScript/Resources/Types/ExtensionTypes.txt.meta
  5. 87
      Assets/Fungus/FungusScript/Resources/Types/RegisterTypes.txt
  6. 8
      Assets/Fungus/FungusScript/Resources/Types/RegisterTypes.txt.meta
  7. 65
      Assets/Fungus/FungusScript/Scripts/Editor/FungusScriptEditor.cs
  8. 4
      Assets/Fungus/FungusScript/Scripts/Editor/FungusScriptEditor.cs.meta
  9. 19
      Assets/Fungus/FungusScript/Scripts/Editor/LuaBindingsEditor.cs
  10. 11
      Assets/Fungus/FungusScript/Scripts/Editor/MenuItems.cs
  11. 140
      Assets/Fungus/FungusScript/Scripts/FungusScript.cs
  12. 25
      Assets/Fungus/FungusScript/Scripts/LuaBindings.cs
  13. 40
      Assets/Fungus/FungusScript/Thirdparty/FungusExtensions/RegisterFungusTypes.cs
  14. 1321
      Assets/Tests/FungusScript/FungusTests.unity
  15. 446
      Assets/Tests/FungusScript/ScriptingTests.unity

4
Assets/Fungus/FungusScript/Resources/Prefabs/FungusScript.prefab

@ -43,6 +43,10 @@ MonoBehaviour:
stringTable: {fileID: 0} stringTable: {fileID: 0}
activeLanguage: en activeLanguage: en
timeScale: -1 timeScale: -1
registerTypes:
- {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3}
registerExtensionTypes:
- {fileID: 4900000, guid: 2978c0ed6806b42629d2bf7d0d1f220c, type: 3}
--- !u!1001 &100100000 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

9
Assets/Fungus/FungusScript/Resources/Types.meta

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 57dca145d09854514a2a33ff8e42bfba
folderAsset: yes
timeCreated: 1459352267
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

2
Assets/Fungus/FungusScript/Resources/Types/ExtensionTypes.txt

@ -0,0 +1,2 @@
Fungus.FungusScriptExtensions, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

8
Assets/Fungus/FungusScript/Resources/Types/ExtensionTypes.txt.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2978c0ed6806b42629d2bf7d0d1f220c
timeCreated: 1459352238
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

87
Assets/Fungus/FungusScript/Resources/Types/RegisterTypes.txt

@ -0,0 +1,87 @@
Fungus.AnimatorVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.AudioSourceVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Block, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.BooleanVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Character, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.ColorVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Command, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.CommandInfoAttribute, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.FacingDirection, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.FloatVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Flowchart, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.FungusPrefs, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.FungusScript, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.GameObjectVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.IntegerVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Label, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.MaterialVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.MenuDialog, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.ObjectVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.PortraitState, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.SayDialog, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.SpriteVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.StringVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.TextureVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.TransformVariable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Variable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Vector2Variable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Fungus.Vector3Variable, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
System.Action, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Collections.IEnumerator, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.IntPtr, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.UInt32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Task, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.AudioClip, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.AudioClipLoadType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.AudioDataLoadState, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.AudioSource, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Bounds, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Canvas, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Color, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.ComputeBuffer, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Coroutine, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.EventSystems.BaseEventData, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.EventSystems.PointerEventData, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Font, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.FontStyle, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.HorizontalWrapMode, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Material, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.MaterialGlobalIlluminationFlags, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Matrix4x4, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.MonoBehaviour, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Quaternion, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Rect, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.RectTransform, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.ScriptableObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Shader, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Sprite, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.SpriteMeshType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.SpritePackingMode, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.SpritePackingRotation, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.TextAnchor, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.TextGenerationSettings, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.TextGenerator, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Texture, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Texture2D, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.TextureFormat, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Time, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Transform, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.UI.Button, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.UI.Image, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.UI.Slider, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.UI.Text, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Vector2, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Vector3, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.Vector4, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
UnityEngine.VerticalWrapMode, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

8
Assets/Fungus/FungusScript/Resources/Types/RegisterTypes.txt.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9c3ab7a98d51241bbb499643399fa761
timeCreated: 1459352229
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

65
Assets/Fungus/FungusScript/Scripts/Editor/FungusScriptEditor.cs

@ -0,0 +1,65 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.IO;
namespace Fungus
{
[CustomEditor (typeof(FungusScript))]
public class FungusScriptEditor : Editor
{
protected SerializedProperty registerTypesProp;
protected ReorderableList registerTypeList;
protected SerializedProperty registerExtensionTypesProp;
protected ReorderableList registerExtensionTypesList;
protected virtual void OnEnable()
{
registerTypesProp = serializedObject.FindProperty("registerTypes");
registerTypeList = new ReorderableList(serializedObject, registerTypesProp, true, true, true, true);
registerTypeList.drawHeaderCallback = (Rect rect) => {
EditorGUI.LabelField(rect, "Register Types");
};
registerTypeList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
Rect r = new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight);
SerializedProperty element = registerTypesProp.GetArrayElementAtIndex(index);
EditorGUI.PropertyField(r, element, new GUIContent(""));
};
registerExtensionTypesProp = serializedObject.FindProperty("registerExtensionTypes");
registerExtensionTypesList = new ReorderableList(serializedObject, registerExtensionTypesProp, true, true, true, true);
registerExtensionTypesList.drawHeaderCallback = (Rect rect) => {
EditorGUI.LabelField(rect, "Register Extension Types");
};
registerExtensionTypesList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
Rect r = new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight);
SerializedProperty element = registerExtensionTypesProp.GetArrayElementAtIndex(index);
EditorGUI.PropertyField(r, element, new GUIContent(""));
};
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
registerTypeList.DoLayoutList();
registerExtensionTypesList.DoLayoutList();
serializedObject.ApplyModifiedProperties();
}
}
}

4
Assets/Fungus/FungusScript/Thirdparty/FungusExtensions/RegisterFungusTypes.cs.meta → Assets/Fungus/FungusScript/Scripts/Editor/FungusScriptEditor.cs.meta

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: becdb52a4ba7c476d89008442adfc3ef guid: f4acd124c87104104a6b71bff9b35b0b
timeCreated: 1458920418 timeCreated: 1459332962
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2

19
Assets/Fungus/FungusScript/Scripts/Editor/LuaBindingsEditor.cs

@ -148,12 +148,6 @@ namespace Fungus
ShowBindingMemberInfo(); ShowBindingMemberInfo();
// Update the bound types on every tick to make sure they're up to date.
// This could be a bit heavy on performance if the bound object list is long, but
// I couldn't get it to work reliably by only updating when the list has changed.
// This only happens when inspecting a Fungus Bindings component so I think it'll be ok.
PopulateBoundTypes();
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
} }
@ -345,7 +339,7 @@ namespace Fungus
/// <summary> /// <summary>
/// Update the list of bound types on the LuaBindings object. /// Update the list of bound types on the LuaBindings object.
/// </summary> /// </summary>
protected virtual void PopulateBoundTypes() protected virtual void PopulateUserDataTypes()
{ {
LuaBindings luaBindings = target as LuaBindings; LuaBindings luaBindings = target as LuaBindings;
@ -367,17 +361,12 @@ namespace Fungus
} }
} }
// Store the final list of types in the luaBindings object string s = "";
SerializedProperty boundTypesProp = serializedObject.FindProperty("boundTypes");
boundTypesProp.ClearArray();
int index = 0;
foreach (System.Type t in typeSet) foreach (System.Type t in typeSet)
{ {
boundTypesProp.InsertArrayElementAtIndex(index); s += t.AssemblyQualifiedName + "\n";
SerializedProperty element = boundTypesProp.GetArrayElementAtIndex(index);
element.stringValue = t.AssemblyQualifiedName;
index++;
} }
Debug.Log(s);
} }
/// <summary> /// <summary>

11
Assets/Fungus/FungusScript/Scripts/Editor/MenuItems.cs

@ -84,6 +84,17 @@ namespace Fungus
return go; return go;
} }
/// <summary>
/// Create new asset from <see cref="ScriptableObject"/> type with unique name at
/// selected folder in project window. Asset creation can be cancelled by pressing
/// escape key when asset is initially being named.
/// </summary>
/// <typeparam name="T">Type of scriptable object.</typeparam>
public static void CreateAsset<T>() where T : ScriptableObject {
var asset = ScriptableObject.CreateInstance<T>();
ProjectWindowUtil.CreateAsset(asset, typeof(T).Name + ".asset");
}
} }
} }

140
Assets/Fungus/FungusScript/Scripts/FungusScript.cs

@ -97,6 +97,18 @@ namespace Fungus
[Tooltip("Time scale factor to apply when running Lua scripts. If negative then uses the same values as the standard Time class.")] [Tooltip("Time scale factor to apply when running Lua scripts. If negative then uses the same values as the standard Time class.")]
public float timeScale = -1f; public float timeScale = -1f;
/// <summary>
/// A text file listing the c# types that can be accessed from Lua.
/// </summary>
[HideInInspector]
public List<TextAsset> registerTypes = new List<TextAsset>();
/// <summary>
/// A text file listing the c# extension types that can be accessed from Lua.
/// </summary>
[HideInInspector]
public List<TextAsset> registerExtensionTypes = new List<TextAsset>();
/// <summary> /// <summary>
/// Instance of remote debugging service when debugging option is enabled. /// Instance of remote debugging service when debugging option is enabled.
/// </summary> /// </summary>
@ -134,12 +146,11 @@ namespace Fungus
// See the MoonSharp documentation for details. // See the MoonSharp documentation for details.
interpreter = new Script(CoreModules.Preset_Complete); interpreter = new Script(CoreModules.Preset_Complete);
RegisterLuaScriptFiles(); InitLuaScriptFiles();
RegisterCLRTypes(); InitTypes();
RegisterFungus(); InitCustomObjects();
RegisterCLRClassObjects(); InitBindings();
RegisterBindings(); InitStringTable();
LoadStringTable();
if (remoteDebugger) if (remoteDebugger)
{ {
@ -152,74 +163,97 @@ namespace Fungus
/// <summary> /// <summary>
/// Register all Lua files in the project so they can be accessed at runtime. /// Register all Lua files in the project so they can be accessed at runtime.
/// </summary> /// </summary>
protected virtual void RegisterLuaScriptFiles() protected virtual void InitLuaScriptFiles()
{ {
object[] result = Resources.LoadAll("Lua", typeof(TextAsset)); object[] result = Resources.LoadAll("Lua", typeof(TextAsset));
interpreter.Options.ScriptLoader = new FungusScriptLoader(result.OfType<TextAsset>()); interpreter.Options.ScriptLoader = new FungusScriptLoader(result.OfType<TextAsset>());
} }
/// <summary> /// <summary>
/// Registers a commonly used subset of Unity types for Lua interop. /// Registers all listed c# types for interop with Lua.
/// To register more types externally to this class, register them in the Awake method of any /// You can also register types directly in the Awake method of any
/// monobehavior in your scene. /// monobehavior in your scene using UserData.RegisterType() directly.
/// </summary> /// </summary>
protected virtual void RegisterCLRTypes() protected virtual void InitTypes()
{ {
// Core types needed by FungusScript // Register types
UserData.RegisterType<GameObject>(); foreach (TextAsset textFile in registerTypes)
UserData.RegisterType<Component>(); {
UserData.RegisterType<MonoBehaviour>(); if (textFile == null)
UserData.RegisterType<ScriptableObject>(); {
UserData.RegisterType<IEnumerator>(); continue;
UserData.RegisterType<UnityEngine.Coroutine>(); }
UserData.RegisterType<Task>();
char[] separators = { '\r', '\n' };
// Monobehaviors and other Unity.Objects foreach (string typeName in textFile.text.Split(separators, StringSplitOptions.RemoveEmptyEntries))
UserData.RegisterType<FungusScript>(); {
UserData.RegisterType<Transform>(); RegisterType(typeName.Trim());
UserData.RegisterType<RectTransform>(); }
UserData.RegisterType<Material>(); }
UserData.RegisterType<Texture>();
UserData.RegisterType<Sprite>(); // Register extension types
UserData.RegisterType<AudioClip>(); foreach (TextAsset textFile in registerExtensionTypes)
UserData.RegisterType<AudioSource>(); {
if (textFile == null)
// Value types {
UserData.RegisterType<Vector2>(); continue;
UserData.RegisterType<Vector3>(); }
UserData.RegisterType<Rect>();
UserData.RegisterType<Quaternion>(); char[] separators = { '\r', '\n' };
UserData.RegisterType<Color>(); foreach (string typeName in textFile.text.Split(separators, StringSplitOptions.RemoveEmptyEntries))
UserData.RegisterType<Time>(); {
UserData.RegisterType<FungusPrefs>(); RegisterExtensionType(typeName.Trim());
}
}
} }
/// <summary> /// <summary>
/// Registers the most common types used by Fungus. /// Register a type given it's assembly qualified name.
/// </summary> /// </summary>
protected virtual void RegisterFungus() public virtual void RegisterType(string typeName)
{ {
RegisterFungusTypes.Register(); System.Type t = System.Type.GetType(typeName);
if (t == null)
{
UnityEngine.Debug.LogWarning("Type not found: " + typeName);
return;
}
if (!UserData.IsTypeRegistered(t))
{
UserData.RegisterType(t);
}
} }
/// <summary> /// <summary>
/// Registers a commonly used subset of Unity class objects for Lua interop. /// Register an extension type given it's assembly qualified name.
/// </summary>
public virtual void RegisterExtensionType(string typeName)
{
System.Type t = System.Type.GetType(typeName);
if (t == null)
{
UnityEngine.Debug.LogWarning("Extension type not found: " + typeName);
return;
}
if (!UserData.IsTypeRegistered(t))
{
UserData.RegisterExtensionType(t);
}
}
/// <summary>
/// Register some commonly used Unity classes and objects for Lua interop.
/// To register more class objects externally to this class, register them in the Awake method of any /// To register more class objects externally to this class, register them in the Awake method of any
/// monobehavior in your scene. /// monobehavior in your scene.
/// </summary> /// </summary>
protected virtual void RegisterCLRClassObjects() protected virtual void InitCustomObjects()
{ {
// Add the CLR class objects to a global unity table // Add the CLR class objects to a global unity table
Table unityTable = new Table(interpreter); Table unityTable = new Table(interpreter);
interpreter.Globals["unity"] = unityTable; interpreter.Globals["unity"] = unityTable;
// Instances of these types can be created in Lua using e.g. c = unity.color.__new()
unityTable["vector2"] = typeof(Vector2);
unityTable["vector3"] = typeof(Vector3);
unityTable["rect"] = typeof(Rect);
unityTable["quaternion"] = typeof(Quaternion);
unityTable["color"] = typeof(Color);
// Static classes // Static classes
unityTable["time"] = UserData.CreateStatic(typeof(Time)); unityTable["time"] = UserData.CreateStatic(typeof(Time));
unityTable["fungusprefs"] = UserData.CreateStatic(typeof(FungusPrefs)); unityTable["fungusprefs"] = UserData.CreateStatic(typeof(FungusPrefs));
@ -243,7 +277,7 @@ namespace Fungus
/// <summary> /// <summary>
/// Binds all gameobjects and components defined in FungusBinding objects to the global scene table. /// Binds all gameobjects and components defined in FungusBinding objects to the global scene table.
/// </summary> /// </summary>
protected virtual void RegisterBindings() protected virtual void InitBindings()
{ {
LuaBindings[] bindings = GameObject.FindObjectsOfType<LuaBindings>(); LuaBindings[] bindings = GameObject.FindObjectsOfType<LuaBindings>();
foreach (LuaBindings binding in bindings) foreach (LuaBindings binding in bindings)
@ -255,7 +289,7 @@ namespace Fungus
/// <summary> /// <summary>
/// Loads the global string table used for localisation. /// Loads the global string table used for localisation.
/// </summary> /// </summary>
protected virtual void LoadStringTable() protected virtual void InitStringTable()
{ {
if (stringTable != null) if (stringTable != null)
{ {

25
Assets/Fungus/FungusScript/Scripts/LuaBindings.cs

@ -38,13 +38,6 @@ namespace Fungus
[Tooltip("The list of Unity objects to be bound to make them accessible in Lua script.")] [Tooltip("The list of Unity objects to be bound to make them accessible in Lua script.")]
public List<BoundObject> boundObjects = new List<BoundObject>(); public List<BoundObject> boundObjects = new List<BoundObject>();
/// <summary>
/// The complete list of types used by the currently bound objects.
/// This includes the bound object types themselves, plus all the other types they use in public properties, fields and methods.
/// </summary>
[HideInInspector]
public List<string> boundTypes = new List<string>();
/// <summary> /// <summary>
/// Always ensure there is at least one row in the bound objects list. /// Always ensure there is at least one row in the bound objects list.
/// </summary> /// </summary>
@ -89,8 +82,6 @@ namespace Fungus
Debug.LogError("Bindings table must not be null"); Debug.LogError("Bindings table must not be null");
} }
RegisterBoundTypes();
for (int i = 0; i < boundObjects.Count; ++i) for (int i = 0; i < boundObjects.Count; ++i)
{ {
// Ignore empty keys // Ignore empty keys
@ -132,22 +123,6 @@ namespace Fungus
} }
} }
} }
/// <summary>
/// Registers the list of bound types with MoonSharp.
/// </summary>
protected virtual void RegisterBoundTypes()
{
foreach (string typeName in boundTypes)
{
System.Type t = System.Type.GetType(typeName);
if (t != null &&
!UserData.IsTypeRegistered(t))
{
UserData.RegisterType(t);
}
}
}
} }
} }

40
Assets/Fungus/FungusScript/Thirdparty/FungusExtensions/RegisterFungusTypes.cs vendored

@ -1,40 +0,0 @@
using UnityEngine;
using System.Collections;
using MoonSharp.Interpreter;
using Fungus;
namespace Fungus
{
public class RegisterFungusTypes
{
/// <summary>
/// Extension for FungusScript that registers all types used by Fungus.
/// </summary>
public static void Register()
{
UserData.RegisterType<Flowchart>();
UserData.RegisterType<Block>();
UserData.RegisterType<Variable>();
UserData.RegisterType<BooleanVariable>();
UserData.RegisterType<ColorVariable>();
UserData.RegisterType<FloatVariable>();
UserData.RegisterType<GameObjectVariable>();
UserData.RegisterType<IntegerVariable>();
UserData.RegisterType<MaterialVariable>();
UserData.RegisterType<ObjectVariable>();
UserData.RegisterType<SpriteVariable>();
UserData.RegisterType<StringVariable>();
UserData.RegisterType<TextureVariable>();
UserData.RegisterType<Vector2Variable>();
UserData.RegisterType<Vector3Variable>();
UserData.RegisterType<AnimatorVariable>();
UserData.RegisterType<AudioSourceVariable>();
UserData.RegisterType<TransformVariable>();
// Extension types
UserData.RegisterExtensionType(typeof(FungusScriptExtensions));
}
}
}

1321
Assets/Tests/FungusScript/FungusTests.unity

File diff suppressed because it is too large Load Diff

446
Assets/Tests/FungusScript/ScriptingTests.unity

@ -135,65 +135,6 @@ Transform:
- {fileID: 385045793} - {fileID: 385045793}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
--- !u!1001 &225242604
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1432843345}
m_Modifications:
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
propertyPath: customScript
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 1118128940}
m_IsPrefabParent: 0
--- !u!4 &225242605
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 225242604}
m_GameObject: {fileID: 1118128940}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1432843345}
m_RootOrder: 0
--- !u!1 &236999593 --- !u!1 &236999593
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -268,6 +209,7 @@ MonoBehaviour:
stringTable: {fileID: 0} stringTable: {fileID: 0}
activeLanguage: en activeLanguage: en
timeScale: -1 timeScale: -1
typeRegistries: []
--- !u!1001 &364012152 --- !u!1001 &364012152
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -313,37 +255,15 @@ Prefab:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 364012154}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!4 &364012153 --- !u!4 &364012153 stripped
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 364012152} m_PrefabInternal: {fileID: 364012152}
m_GameObject: {fileID: 364012154} --- !u!1 &364012154 stripped
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1900871526}
m_RootOrder: 0
--- !u!1 &364012154
GameObject: GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 364012152} m_PrefabInternal: {fileID: 364012152}
serializedVersion: 4
m_Component:
- 4: {fileID: 364012153}
- 114: {fileID: 364012156}
- 114: {fileID: 364012155}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &364012155 --- !u!114 &364012155
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -411,34 +331,10 @@ MonoBehaviour:
fungus.pass()' fungus.pass()'
runAsCoroutine: 1 runAsCoroutine: 1
useFungusModule: 1 useFungusModule: 1
--- !u!114 &364012156 --- !u!4 &385045793 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 364012152}
m_GameObject: {fileID: 364012154}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 0}
activeLanguage: en
timeScale: -1
--- !u!4 &385045793
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1073733979} m_PrefabInternal: {fileID: 1073733979}
m_GameObject: {fileID: 1111820868}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 47556549}
m_RootOrder: 0
--- !u!1 &637150167 --- !u!1 &637150167
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -488,7 +384,7 @@ Transform:
m_Children: m_Children:
- {fileID: 236999594} - {fileID: 236999594}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 10 m_RootOrder: 9
--- !u!1 &715881501 --- !u!1 &715881501
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -538,7 +434,7 @@ Transform:
m_Children: m_Children:
- {fileID: 2093904138} - {fileID: 2093904138}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 5
--- !u!1 &1052730009 --- !u!1 &1052730009
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -578,41 +474,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 6
--- !u!1 &1058559143
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 178698, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2}
m_PrefabInternal: {fileID: 2076961667}
serializedVersion: 4
m_Component:
- 4: {fileID: 1500823905}
- 114: {fileID: 1058559144}
m_Layer: 0
m_Name: FungusBindings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1058559144
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11414792, guid: e0c2b90c058ff43f4a56a266d4fa721b,
type: 2}
m_PrefabInternal: {fileID: 2076961667}
m_GameObject: {fileID: 1058559143}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4cc8a659e950044b69d7c62696c36962, type: 3}
m_Name:
m_EditorClassIdentifier:
tableName:
boundObjects:
- key: dummy
obj: {fileID: 2101848760}
component: {fileID: 0}
boundTypes: []
--- !u!1001 &1073733979 --- !u!1001 &1073733979
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -664,25 +526,11 @@ Prefab:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 1111820868}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!1 &1111820868 --- !u!1 &1111820868 stripped
GameObject: GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1073733979} m_PrefabInternal: {fileID: 1073733979}
serializedVersion: 4
m_Component:
- 4: {fileID: 385045793}
- 114: {fileID: 1111820870}
- 114: {fileID: 1111820869}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1111820869 --- !u!114 &1111820869
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -711,99 +559,10 @@ MonoBehaviour:
f.pass()' f.pass()'
runAsCoroutine: 1 runAsCoroutine: 1
useFungusModule: 1 useFungusModule: 1
--- !u!114 &1111820870 --- !u!4 &1272779136 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 1073733979}
m_GameObject: {fileID: 1111820868}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 0}
activeLanguage: en
timeScale: -1
--- !u!1 &1118128940
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 225242604}
serializedVersion: 4
m_Component:
- 4: {fileID: 225242605}
- 114: {fileID: 1118128942}
- 114: {fileID: 1118128941}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1118128941
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1118128940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3}
m_Name:
m_EditorClassIdentifier:
executeAfterTime: 1
repeatExecuteTime: 1
repeatEveryTime: 1
executeAfterFrames: 1
repeatExecuteFrame: 1
repeatEveryFrame: 1
hasFailed: 0
executeMethods: 2
fungusScript: {fileID: 0}
luaFile: {fileID: 0}
luaScript: '-- Test instantiating a CLR type from Lua
local c = unity.color.__new()
unity.test.assert(c != nil)
unity.test.pass()
'
runAsCoroutine: 1
useFungusModule: 1
--- !u!114 &1118128942
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 225242604}
m_GameObject: {fileID: 1118128940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 0}
activeLanguage: en
timeScale: -1
--- !u!4 &1272779136
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1501132865} m_PrefabInternal: {fileID: 1501132865}
m_GameObject: {fileID: 1860855006}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1960220032}
m_RootOrder: 0
--- !u!1 &1394431693 --- !u!1 &1394431693
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -890,68 +649,10 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
--- !u!1 &1432843343 --- !u!4 &1500823905 stripped
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1432843345}
- 114: {fileID: 1432843344}
m_Layer: 0
m_Name: ClassNewTest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &1432843344
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1432843343}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3}
m_Name:
m_EditorClassIdentifier:
timeout: 5
ignored: 0
succeedAfterAllAssertionsAreExecuted: 0
expectException: 0
expectedExceptionList:
succeedWhenExceptionIsThrown: 0
includedPlatforms: -1
platformsToIgnore: []
dynamic: 0
dynamicTypeName:
--- !u!4 &1432843345
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1432843343}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 225242605}
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!4 &1500823905
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 403334, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2} m_PrefabParentObject: {fileID: 403334, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2}
m_PrefabInternal: {fileID: 2076961667} m_PrefabInternal: {fileID: 2076961667}
m_GameObject: {fileID: 1058559143}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1960220032}
m_RootOrder: 1
--- !u!1001 &1501132865 --- !u!1001 &1501132865
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -997,7 +698,6 @@ Prefab:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 1860855006}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!1 &1532103952 --- !u!1 &1532103952
GameObject: GameObject:
@ -1014,7 +714,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 &1532103953 --- !u!114 &1532103953
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1048,7 +748,7 @@ Transform:
m_Children: m_Children:
- {fileID: 1855619326} - {fileID: 1855619326}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 3
--- !u!1 &1549270604 --- !u!1 &1549270604
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -1088,7 +788,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 9 m_RootOrder: 8
--- !u!1 &1734188738 --- !u!1 &1734188738
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1162,7 +862,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 8 m_RootOrder: 7
--- !u!1001 &1855619325 --- !u!1001 &1855619325
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1209,37 +909,15 @@ Prefab:
m_RemovedComponents: m_RemovedComponents:
- {fileID: 11403674, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - {fileID: 11403674, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 1855619327}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!4 &1855619326 --- !u!4 &1855619326 stripped
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1855619325} m_PrefabInternal: {fileID: 1855619325}
m_GameObject: {fileID: 1855619327} --- !u!1 &1855619327 stripped
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1532103954}
m_RootOrder: 0
--- !u!1 &1855619327
GameObject: GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1855619325} m_PrefabInternal: {fileID: 1855619325}
serializedVersion: 4
m_Component:
- 4: {fileID: 1855619326}
- 114: {fileID: 1855619329}
- 114: {fileID: 1855619328}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1855619328 --- !u!114 &1855619328
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1309,39 +987,10 @@ MonoBehaviour:
fungus.pass()' fungus.pass()'
runAsCoroutine: 1 runAsCoroutine: 1
useFungusModule: 1 useFungusModule: 1
--- !u!114 &1855619329 --- !u!1 &1860855006 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 1855619325}
m_GameObject: {fileID: 1855619327}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 4900000, guid: 9900570d789fa4b29957e4b897af9e3b, type: 3}
activeLanguage: en
timeScale: -1
--- !u!1 &1860855006
GameObject: GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 1501132865} m_PrefabInternal: {fileID: 1501132865}
serializedVersion: 4
m_Component:
- 4: {fileID: 1272779136}
- 114: {fileID: 1860855008}
- 114: {fileID: 1860855007}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1860855007 --- !u!114 &1860855007
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1372,22 +1021,6 @@ MonoBehaviour:
' '
runAsCoroutine: 1 runAsCoroutine: 1
useFungusModule: 1 useFungusModule: 1
--- !u!114 &1860855008
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 1501132865}
m_GameObject: {fileID: 1860855006}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 0}
activeLanguage: en
timeScale: -1
--- !u!1 &1900871524 --- !u!1 &1900871524
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1437,7 +1070,7 @@ Transform:
m_Children: m_Children:
- {fileID: 364012153} - {fileID: 364012153}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 4
--- !u!1 &1960220030 --- !u!1 &1960220030
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1543,7 +1176,6 @@ Prefab:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2} m_ParentPrefab: {fileID: 100100000, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2}
m_RootGameObject: {fileID: 1058559143}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!1001 &2093904137 --- !u!1001 &2093904137
Prefab: Prefab:
@ -1586,37 +1218,15 @@ Prefab:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_RootGameObject: {fileID: 2093904139}
m_IsPrefabParent: 0 m_IsPrefabParent: 0
--- !u!4 &2093904138 --- !u!4 &2093904138 stripped
Transform: Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 2093904137} m_PrefabInternal: {fileID: 2093904137}
m_GameObject: {fileID: 2093904139} --- !u!1 &2093904139 stripped
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 715881503}
m_RootOrder: 0
--- !u!1 &2093904139
GameObject: GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
m_PrefabInternal: {fileID: 2093904137} m_PrefabInternal: {fileID: 2093904137}
serializedVersion: 4
m_Component:
- 4: {fileID: 2093904138}
- 114: {fileID: 2093904141}
- 114: {fileID: 2093904140}
m_Layer: 0
m_Name: FungusScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2093904140 --- !u!114 &2093904140
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1659,22 +1269,6 @@ MonoBehaviour:
' '
runAsCoroutine: 1 runAsCoroutine: 1
useFungusModule: 1 useFungusModule: 1
--- !u!114 &2093904141
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25,
type: 2}
m_PrefabInternal: {fileID: 2093904137}
m_GameObject: {fileID: 2093904139}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3}
m_Name:
m_EditorClassIdentifier:
remoteDebugger: 0
stringTable: {fileID: 0}
activeLanguage: en
timeScale: -1
--- !u!1 &2101848760 --- !u!1 &2101848760
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Loading…
Cancel
Save