From 7c7897fa681df2fd33af120f5a60360d1861a0e0 Mon Sep 17 00:00:00 2001 From: Chris Gregan Date: Thu, 5 May 2016 18:00:14 +0100 Subject: [PATCH] Added all-in-one Lua prefab --- .../FungusLua/Resources/Prefabs/Lua.prefab | 127 ++++++++++++++++++ .../Resources/Prefabs/Lua.prefab.meta | 8 ++ .../FungusLua/Scripts/Editor/MenuItems.cs | 50 ++++--- 3 files changed, 163 insertions(+), 22 deletions(-) create mode 100644 Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab create mode 100644 Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab.meta diff --git a/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab b/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab new file mode 100644 index 00000000..f64868fe --- /dev/null +++ b/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab @@ -0,0 +1,127 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &179118 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 466848} + - 114: {fileID: 11415008} + - 114: {fileID: 11417560} + - 114: {fileID: 11499092} + - 114: {fileID: 11483650} + - 114: {fileID: 11437776} + m_Layer: 0 + m_Name: Lua + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &466848 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + 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: 0} + m_RootOrder: 0 +--- !u!114 &11415008 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + executeMethodName: OnExecute +--- !u!114 &11417560 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + luaEnvironment: {fileID: 11483650} + luaFile: {fileID: 0} + luaScript: + runAsCoroutine: 1 +--- !u!114 &11437776 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + fungusModule: 0 + activeLanguage: en + stringTables: [] + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} + - {fileID: 4900000, guid: 93fddea8208764a2dbb189cc238aed40, type: 3} +--- !u!114 &11483650 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: + remoteDebugger: 0 +--- !u!114 &11499092 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 179118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4cc8a659e950044b69d7c62696c36962, type: 3} + m_Name: + m_EditorClassIdentifier: + tableName: + registerTypes: 1 + boundTypes: [] + boundObjects: + - key: + obj: {fileID: 0} + component: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 179118} + m_IsPrefabParent: 1 diff --git a/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab.meta b/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab.meta new file mode 100644 index 00000000..5d5cc2c1 --- /dev/null +++ b/Assets/Fungus/Thirdparty/FungusLua/Resources/Prefabs/Lua.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ddf9f33ba98e4b31ba4d2b9722bea00 +timeCreated: 1462457182 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs index 550c2f71..2ed9a8d9 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs @@ -8,31 +8,13 @@ namespace Fungus public class MenuItems { - [MenuItem("Tools/Fungus/Create/Lua Environment", false, 2000)] - static void CreateLuaEnvironment() + [MenuItem("Tools/Fungus/Create/Lua", false, 2000)] + static void CreateLua() { - SpawnPrefab("Prefabs/LuaEnvironment", false); - } - - [MenuItem("Tools/Fungus/Create/Lua Bindings", false, 2001)] - static void CreateLuaBindings() - { - SpawnPrefab("Prefabs/LuaBindings", false); + SpawnPrefab("Prefabs/Lua", false); } - [MenuItem("Tools/Fungus/Create/Lua Script", false, 2002)] - static void CreateLuaScript() - { - SpawnPrefab("Prefabs/LuaScript", false); - } - - [MenuItem("Tools/Fungus/Create/Lua Store", false, 2003)] - static void CreateLuaStore() - { - SpawnPrefab("Prefabs/LuaStore", false); - } - - [MenuItem("Tools/Fungus/Create/Lua File", false, 2100)] + [MenuItem("Tools/Fungus/Create/Lua File", false, 2001)] static void CreateLuaFile() { string path = EditorUtility.SaveFilePanelInProject("Create Lua File", "script.txt", "txt", "Please select a file name for the new Lua script. Note: Lua files in Unity use the .txt extension."); @@ -56,6 +38,30 @@ namespace Fungus } } + [MenuItem("Tools/Fungus/Create/Lua Environment", false, 2100)] + static void CreateLuaEnvironment() + { + SpawnPrefab("Prefabs/LuaEnvironment", false); + } + + [MenuItem("Tools/Fungus/Create/Lua Bindings", false, 2101)] + static void CreateLuaBindings() + { + SpawnPrefab("Prefabs/LuaBindings", false); + } + + [MenuItem("Tools/Fungus/Create/Lua Script", false, 2102)] + static void CreateLuaScript() + { + SpawnPrefab("Prefabs/LuaScript", false); + } + + [MenuItem("Tools/Fungus/Create/Lua Store", false, 2103)] + static void CreateLuaStore() + { + SpawnPrefab("Prefabs/LuaStore", false); + } + /// /// Spawns a prefab in the scene based on it's filename in a Resources folder in the project. /// If centerInScene is true then the object will be placed centered in the view window with z = 0.