Browse Source

Merge pull request #430 from FungusGames/register-types-label

Added Register Types label in LuaEnvironment inspector
master
Chris Gregan 9 years ago
parent
commit
83f74fe1fe
  1. 3
      Assets/Fungus/Lua/Scripts/Editor/LuaEnvironmentEditor.cs
  2. 109
      Assets/Tests/Lua/FungusTests.unity

3
Assets/Fungus/Lua/Scripts/Editor/LuaEnvironmentEditor.cs

@ -22,7 +22,7 @@ namespace Fungus
registerTypeList = new ReorderableList(serializedObject, registerTypesProp, true, true, true, true); registerTypeList = new ReorderableList(serializedObject, registerTypesProp, true, true, true, true);
registerTypeList.drawHeaderCallback = (Rect rect) => { registerTypeList.drawHeaderCallback = (Rect rect) => {
EditorGUI.LabelField(rect, "Register Types"); EditorGUI.LabelField(rect, "Type Lists");
}; };
registerTypeList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { registerTypeList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
@ -38,6 +38,7 @@ namespace Fungus
serializedObject.Update(); serializedObject.Update();
EditorGUILayout.PrefixLabel(new GUIContent("Register Types", "Text files which list the CLR types that should be registered with this Lua environment."));
registerTypeList.DoLayoutList(); registerTypeList.DoLayoutList();
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();

109
Assets/Tests/Lua/FungusTests.unity

@ -126,6 +126,8 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes: []
boundObjects: boundObjects:
- key: saydialog - key: saydialog
obj: {fileID: 2087053783} obj: {fileID: 2087053783}
@ -142,7 +144,6 @@ MonoBehaviour:
- key: voiceover - key: voiceover
obj: {fileID: 8300000, guid: d2ab1fbe555d44e9e870311657856bdc, type: 3} obj: {fileID: 8300000, guid: d2ab1fbe555d44e9e870311657856bdc, type: 3}
component: {fileID: 0} component: {fileID: 0}
boundTypes: []
--- !u!1 &13683311 --- !u!1 &13683311
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -711,11 +712,12 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes: []
boundObjects: boundObjects:
- key: menudialog - key: menudialog
obj: {fileID: 560555132} obj: {fileID: 560555132}
component: {fileID: 560555134} component: {fileID: 560555134}
boundTypes: []
--- !u!4 &36455799 stripped --- !u!4 &36455799 stripped
Transform: Transform:
m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2}
@ -1351,6 +1353,8 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes: []
boundObjects: boundObjects:
- key: menudialog - key: menudialog
obj: {fileID: 20972056} obj: {fileID: 20972056}
@ -1358,7 +1362,6 @@ MonoBehaviour:
- key: optionbutton0 - key: optionbutton0
obj: {fileID: 876352038} obj: {fileID: 876352038}
component: {fileID: 876352041} component: {fileID: 876352041}
boundTypes: []
--- !u!1 &190681717 --- !u!1 &190681717
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2713,11 +2716,12 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes: []
boundObjects: boundObjects:
- key: flowchart - key: flowchart
obj: {fileID: 1983492490} obj: {fileID: 1983492490}
component: {fileID: 1983492495} component: {fileID: 1983492495}
boundTypes: []
--- !u!1 &507572619 --- !u!1 &507572619
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3640,6 +3644,37 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes:
- UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
- UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
- UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Fungus.Flowchart, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- Fungus.Block, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.Vector2, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Action, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Fungus.Variable, 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.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
- UnityEngine.Rect, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.RectTransform+ReapplyDrivenProperties, UnityEngine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
- UnityEngine.Vector3, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.RectTransform+Edge, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
- UnityEngine.RectTransform+Axis, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
boundObjects: boundObjects:
- key: flowchart - key: flowchart
obj: {fileID: 115186231} obj: {fileID: 115186231}
@ -3647,7 +3682,6 @@ MonoBehaviour:
- key: transform - key: transform
obj: {fileID: 328064332} obj: {fileID: 328064332}
component: {fileID: 328064333} component: {fileID: 328064333}
boundTypes: []
--- !u!1001 &726346786 --- !u!1001 &726346786
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4829,6 +4863,8 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes: []
boundObjects: boundObjects:
- key: menudialog - key: menudialog
obj: {fileID: 1077682782} obj: {fileID: 1077682782}
@ -4839,7 +4875,6 @@ MonoBehaviour:
- key: - key:
obj: {fileID: 0} obj: {fileID: 0}
component: {fileID: 0} component: {fileID: 0}
boundTypes: []
--- !u!1 &928936324 --- !u!1 &928936324
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -7479,7 +7514,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 &1647235603 --- !u!114 &1647235603
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8124,11 +8159,34 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
registerTypes: 1
boundTypes:
- UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
- UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
- UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Fungus.Flowchart, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- Fungus.Block, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.Vector2, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.Action, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Fungus.Variable, 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.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
- UnityEngine.Rect, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
boundObjects: boundObjects:
- key: flowchart - key: flowchart
obj: {fileID: 807616582} obj: {fileID: 807616582}
component: {fileID: 807616590} component: {fileID: 807616590}
boundTypes: []
--- !u!1 &1738857300 --- !u!1 &1738857300
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8144,7 +8202,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!114 &1738857301 --- !u!114 &1738857301
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -9718,22 +9776,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tableName: tableName:
boundObjects: registerTypes: 1
- key: flowchart
obj: {fileID: 942227023}
component: {fileID: 942227028}
- key: testgameobject
obj: {fileID: 95979348}
component: {fileID: 0}
- key: testmaterial
obj: {fileID: 2100000, guid: 97a4dac23b6bb49888243026c50076a9, type: 2}
component: {fileID: 0}
- key: mushroom
obj: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3}
component: {fileID: 0}
- key: mousepointer
obj: {fileID: 2800000, guid: efe8aa62cc87f4b70b9272e4e8e06668, type: 3}
component: {fileID: 0}
boundTypes: boundTypes:
- UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
@ -9777,6 +9820,22 @@ MonoBehaviour:
PublicKeyToken=null PublicKeyToken=null
- UnityEngine.TextureFormat, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.TextureFormat, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- System.IntPtr, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.IntPtr, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
boundObjects:
- key: flowchart
obj: {fileID: 942227023}
component: {fileID: 942227028}
- key: testgameobject
obj: {fileID: 95979348}
component: {fileID: 0}
- key: testmaterial
obj: {fileID: 2100000, guid: 97a4dac23b6bb49888243026c50076a9, type: 2}
component: {fileID: 0}
- key: mushroom
obj: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3}
component: {fileID: 0}
- key: mousepointer
obj: {fileID: 2800000, guid: efe8aa62cc87f4b70b9272e4e8e06668, type: 3}
component: {fileID: 0}
--- !u!1 &2119731355 --- !u!1 &2119731355
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Loading…
Cancel
Save