Repository: yanghuan/CSharpLuaForUnity
Branch: master
Commit: b2945e3c7950
Files: 842
Total size: 3.1 MB
Directory structure:
gitextract_wjxhfzse/
├── .gitignore
├── Assets/
│ ├── CSharpLua/
│ │ ├── Base/
│ │ │ ├── BaseScripts.asmdef
│ │ │ ├── BaseScripts.asmdef.meta
│ │ │ ├── CSharpLua/
│ │ │ │ ├── BaseUtility.cs
│ │ │ │ ├── BaseUtility.cs.meta
│ │ │ │ ├── LuaAutoWrapAttribute.cs
│ │ │ │ ├── LuaAutoWrapAttribute.cs.meta
│ │ │ │ ├── Settings.cs
│ │ │ │ └── Settings.cs.meta
│ │ │ └── CSharpLua.meta
│ │ ├── Base.meta
│ │ ├── Bridge/
│ │ │ ├── BridgeScripts.asmdef
│ │ │ ├── BridgeScripts.asmdef.meta
│ │ │ ├── TestUtils.cs
│ │ │ └── TestUtils.cs.meta
│ │ ├── Bridge.meta
│ │ ├── CSharpLuaClient.cs
│ │ ├── CSharpLuaClient.cs.meta
│ │ ├── Compiled/
│ │ │ ├── CompiledScripts.asmdef
│ │ │ ├── CompiledScripts.asmdef.meta
│ │ │ ├── Protocol/
│ │ │ │ ├── AutoGen/
│ │ │ │ │ ├── CommonPrototype.cs
│ │ │ │ │ └── CommonPrototype.cs.meta
│ │ │ │ ├── AutoGen.meta
│ │ │ │ ├── CommonPrototype.proto
│ │ │ │ ├── CommonPrototype.proto.meta
│ │ │ │ ├── IProtocol.cs
│ │ │ │ └── IProtocol.cs.meta
│ │ │ ├── Protocol.meta
│ │ │ ├── Sample/
│ │ │ │ ├── TestCoroutine.cs
│ │ │ │ ├── TestCoroutine.cs.meta
│ │ │ │ ├── TestHangingScript.cs
│ │ │ │ ├── TestHangingScript.cs.meta
│ │ │ │ ├── TestHelloWord.cs
│ │ │ │ ├── TestHelloWord.cs.meta
│ │ │ │ ├── TestProtobuf.cs
│ │ │ │ └── TestProtobuf.cs.meta
│ │ │ └── Sample.meta
│ │ ├── Compiled.meta
│ │ ├── Editor/
│ │ │ ├── Compiler.cs
│ │ │ └── Compiler.cs.meta
│ │ ├── Editor.meta
│ │ ├── Examples/
│ │ │ ├── 01_HelloWorld/
│ │ │ │ ├── HelloWorld.unity
│ │ │ │ ├── HelloWorld.unity.meta
│ │ │ │ ├── TestLoader.prefab
│ │ │ │ ├── TestLoader.prefab.meta
│ │ │ │ ├── testText.txt
│ │ │ │ └── testText.txt.meta
│ │ │ └── 01_HelloWorld.meta
│ │ ├── Examples.meta
│ │ ├── UserMonoBehaviourConverter.cs
│ │ └── UserMonoBehaviourConverter.cs.meta
│ ├── CSharpLua.meta
│ ├── Editor/
│ │ ├── Custom/
│ │ │ ├── CustomSettings.cs
│ │ │ └── CustomSettings.cs.meta
│ │ └── Custom.meta
│ ├── Editor.meta
│ ├── Lua/
│ │ ├── 3rd/
│ │ │ ├── pbc/
│ │ │ │ ├── Protocol/
│ │ │ │ │ ├── CommonPrototype.pb
│ │ │ │ │ └── CommonPrototype.pb.meta
│ │ │ │ ├── Protocol.meta
│ │ │ │ ├── protobuf.lua
│ │ │ │ └── protobuf.lua.meta
│ │ │ └── pbc.meta
│ │ ├── 3rd.meta
│ │ ├── Classloader.lua
│ │ ├── Classloader.lua.meta
│ │ ├── Compiled/
│ │ │ ├── Protocol/
│ │ │ │ ├── AutoGen/
│ │ │ │ │ ├── CommonPrototype.lua
│ │ │ │ │ └── CommonPrototype.lua.meta
│ │ │ │ ├── AutoGen.meta
│ │ │ │ ├── IProtocol.lua
│ │ │ │ └── IProtocol.lua.meta
│ │ │ ├── Protocol.meta
│ │ │ ├── Sample/
│ │ │ │ ├── TestCoroutine.lua
│ │ │ │ ├── TestCoroutine.lua.meta
│ │ │ │ ├── TestHangingScript.lua
│ │ │ │ ├── TestHangingScript.lua.meta
│ │ │ │ ├── TestHelloWord.lua
│ │ │ │ ├── TestHelloWord.lua.meta
│ │ │ │ ├── TestProtobuf.lua
│ │ │ │ └── TestProtobuf.lua.meta
│ │ │ ├── Sample.meta
│ │ │ ├── manifest.lua
│ │ │ └── manifest.lua.meta
│ │ ├── Compiled.meta
│ │ ├── CoreSystemLua/
│ │ │ ├── All.lua
│ │ │ ├── All.lua.meta
│ │ │ ├── CoreSystem/
│ │ │ │ ├── Array.lua
│ │ │ │ ├── Array.lua.meta
│ │ │ │ ├── Boolean.lua
│ │ │ │ ├── Boolean.lua.meta
│ │ │ │ ├── Char.lua
│ │ │ │ ├── Char.lua.meta
│ │ │ │ ├── Collections/
│ │ │ │ │ ├── Dictionary.lua
│ │ │ │ │ ├── Dictionary.lua.meta
│ │ │ │ │ ├── EqualityComparer.lua
│ │ │ │ │ ├── EqualityComparer.lua.meta
│ │ │ │ │ ├── HashSet.lua
│ │ │ │ │ ├── HashSet.lua.meta
│ │ │ │ │ ├── LinkedList.lua
│ │ │ │ │ ├── LinkedList.lua.meta
│ │ │ │ │ ├── Linq.lua
│ │ │ │ │ ├── Linq.lua.meta
│ │ │ │ │ ├── List.lua
│ │ │ │ │ ├── List.lua.meta
│ │ │ │ │ ├── Queue.lua
│ │ │ │ │ ├── Queue.lua.meta
│ │ │ │ │ ├── SortedSet.lua
│ │ │ │ │ ├── SortedSet.lua.meta
│ │ │ │ │ ├── Stack.lua
│ │ │ │ │ └── Stack.lua.meta
│ │ │ │ ├── Collections.meta
│ │ │ │ ├── Console.lua
│ │ │ │ ├── Console.lua.meta
│ │ │ │ ├── Convert.lua
│ │ │ │ ├── Convert.lua.meta
│ │ │ │ ├── Core.lua
│ │ │ │ ├── Core.lua.meta
│ │ │ │ ├── DateTime.lua
│ │ │ │ ├── DateTime.lua.meta
│ │ │ │ ├── Delegate.lua
│ │ │ │ ├── Delegate.lua.meta
│ │ │ │ ├── Enum.lua
│ │ │ │ ├── Enum.lua.meta
│ │ │ │ ├── Exception.lua
│ │ │ │ ├── Exception.lua.meta
│ │ │ │ ├── IO/
│ │ │ │ │ ├── File.lua
│ │ │ │ │ └── File.lua.meta
│ │ │ │ ├── IO.meta
│ │ │ │ ├── Interfaces.lua
│ │ │ │ ├── Interfaces.lua.meta
│ │ │ │ ├── Math.lua
│ │ │ │ ├── Math.lua.meta
│ │ │ │ ├── Number.lua
│ │ │ │ ├── Number.lua.meta
│ │ │ │ ├── Random.lua
│ │ │ │ ├── Random.lua.meta
│ │ │ │ ├── Reflection/
│ │ │ │ │ ├── Assembly.lua
│ │ │ │ │ └── Assembly.lua.meta
│ │ │ │ ├── Reflection.meta
│ │ │ │ ├── String.lua
│ │ │ │ ├── String.lua.meta
│ │ │ │ ├── Text/
│ │ │ │ │ ├── StringBuilder.lua
│ │ │ │ │ └── StringBuilder.lua.meta
│ │ │ │ ├── Text.meta
│ │ │ │ ├── Threading/
│ │ │ │ │ ├── Task.lua
│ │ │ │ │ ├── Task.lua.meta
│ │ │ │ │ ├── Thread.lua
│ │ │ │ │ ├── Thread.lua.meta
│ │ │ │ │ ├── Timer.lua
│ │ │ │ │ └── Timer.lua.meta
│ │ │ │ ├── Threading.meta
│ │ │ │ ├── Threads.meta
│ │ │ │ ├── TimeSpan.lua
│ │ │ │ ├── TimeSpan.lua.meta
│ │ │ │ ├── Type.lua
│ │ │ │ ├── Type.lua.meta
│ │ │ │ ├── Utilities.lua
│ │ │ │ └── Utilities.lua.meta
│ │ │ ├── CoreSystem.meta
│ │ │ ├── Sample/
│ │ │ │ ├── test.lua
│ │ │ │ └── test.lua.meta
│ │ │ └── Sample.meta
│ │ ├── CoreSystemLua.meta
│ │ ├── Main.lua
│ │ ├── Main.lua.meta
│ │ ├── ProtobufAdapter.lua
│ │ ├── ProtobufAdapter.lua.meta
│ │ ├── UnityAdapter.Lua
│ │ └── UnityAdapter.Lua.meta
│ ├── Lua.meta
│ ├── Plugins/
│ │ ├── 3rd/
│ │ │ └── protobuf-net.dll.meta
│ │ ├── 3rd.meta
│ │ ├── Android/
│ │ │ ├── libs/
│ │ │ │ ├── arm64-v8a/
│ │ │ │ │ └── libtolua.so.meta
│ │ │ │ ├── arm64-v8a.meta
│ │ │ │ ├── armeabi-v7a/
│ │ │ │ │ └── libtolua.so.meta
│ │ │ │ ├── armeabi-v7a.meta
│ │ │ │ ├── x86/
│ │ │ │ │ └── libtolua.so.meta
│ │ │ │ └── x86.meta
│ │ │ └── libs.meta
│ │ ├── Android.meta
│ │ ├── CString.dll.meta
│ │ ├── Debugger.dll.meta
│ │ ├── iOS/
│ │ │ ├── libtolua.a
│ │ │ └── libtolua.a.meta
│ │ ├── iOS.meta
│ │ ├── tolua.bundle/
│ │ │ ├── Contents/
│ │ │ │ ├── Info.plist
│ │ │ │ ├── Info.plist.meta
│ │ │ │ ├── MacOS/
│ │ │ │ │ ├── tolua
│ │ │ │ │ └── tolua.meta
│ │ │ │ ├── MacOS.meta
│ │ │ │ ├── Resources/
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── LICENSE.meta
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── README.md.meta
│ │ │ │ │ ├── print_r.lua
│ │ │ │ │ ├── print_r.lua.meta
│ │ │ │ │ ├── sproto.lua
│ │ │ │ │ ├── sproto.lua.meta
│ │ │ │ │ ├── sproto.new/
│ │ │ │ │ │ ├── LICENSE
│ │ │ │ │ │ ├── LICENSE.meta
│ │ │ │ │ │ ├── Makefile
│ │ │ │ │ │ ├── Makefile.meta
│ │ │ │ │ │ ├── README.md
│ │ │ │ │ │ ├── README.md.meta
│ │ │ │ │ │ ├── lsproto.c
│ │ │ │ │ │ ├── lsproto.c.meta
│ │ │ │ │ │ ├── msvcint.h
│ │ │ │ │ │ ├── msvcint.h.meta
│ │ │ │ │ │ ├── print_r.lua
│ │ │ │ │ │ ├── print_r.lua.meta
│ │ │ │ │ │ ├── sproto.c
│ │ │ │ │ │ ├── sproto.c.meta
│ │ │ │ │ │ ├── sproto.h
│ │ │ │ │ │ ├── sproto.h.meta
│ │ │ │ │ │ ├── sproto.lua
│ │ │ │ │ │ ├── sproto.lua.meta
│ │ │ │ │ │ ├── sproto.new.xcodeproj/
│ │ │ │ │ │ │ ├── project.pbxproj
│ │ │ │ │ │ │ └── project.pbxproj.meta
│ │ │ │ │ │ ├── sproto.new.xcodeproj.meta
│ │ │ │ │ │ ├── sprotoparser.lua
│ │ │ │ │ │ ├── sprotoparser.lua.meta
│ │ │ │ │ │ ├── test.lua
│ │ │ │ │ │ ├── test.lua.meta
│ │ │ │ │ │ ├── testall.lua
│ │ │ │ │ │ ├── testall.lua.meta
│ │ │ │ │ │ ├── testrpc.lua
│ │ │ │ │ │ └── testrpc.lua.meta
│ │ │ │ │ ├── sproto.new.meta
│ │ │ │ │ ├── sprotoparser.lua
│ │ │ │ │ ├── sprotoparser.lua.meta
│ │ │ │ │ ├── test.lua
│ │ │ │ │ ├── test.lua.meta
│ │ │ │ │ ├── testall.lua
│ │ │ │ │ ├── testall.lua.meta
│ │ │ │ │ ├── testrpc.lua
│ │ │ │ │ └── testrpc.lua.meta
│ │ │ │ └── Resources.meta
│ │ │ └── Contents.meta
│ │ ├── tolua.bundle.meta
│ │ ├── x86/
│ │ │ └── tolua.dll.meta
│ │ ├── x86.meta
│ │ ├── x86_64/
│ │ │ └── tolua.dll.meta
│ │ └── x86_64.meta
│ ├── Plugins.meta
│ ├── Source/
│ │ ├── Generate.meta
│ │ ├── LuaConst.cs
│ │ └── LuaConst.cs.meta
│ ├── Source.meta
│ ├── ToLua/
│ │ ├── BaseType/
│ │ │ ├── LuaInterface_EventObjectWrap.cs
│ │ │ ├── LuaInterface_EventObjectWrap.cs.meta
│ │ │ ├── LuaInterface_LuaConstructorWrap.cs
│ │ │ ├── LuaInterface_LuaConstructorWrap.cs.meta
│ │ │ ├── LuaInterface_LuaFieldWrap.cs
│ │ │ ├── LuaInterface_LuaFieldWrap.cs.meta
│ │ │ ├── LuaInterface_LuaMethodWrap.cs
│ │ │ ├── LuaInterface_LuaMethodWrap.cs.meta
│ │ │ ├── LuaInterface_LuaOutWrap.cs
│ │ │ ├── LuaInterface_LuaOutWrap.cs.meta
│ │ │ ├── LuaInterface_LuaPropertyWrap.cs
│ │ │ ├── LuaInterface_LuaPropertyWrap.cs.meta
│ │ │ ├── System_ArrayWrap.cs
│ │ │ ├── System_ArrayWrap.cs.meta
│ │ │ ├── System_Collections_Generic_DictionaryWrap.cs
│ │ │ ├── System_Collections_Generic_DictionaryWrap.cs.meta
│ │ │ ├── System_Collections_Generic_Dictionary_KeyCollectionWrap.cs
│ │ │ ├── System_Collections_Generic_Dictionary_KeyCollectionWrap.cs.meta
│ │ │ ├── System_Collections_Generic_Dictionary_ValueCollectionWrap.cs
│ │ │ ├── System_Collections_Generic_Dictionary_ValueCollectionWrap.cs.meta
│ │ │ ├── System_Collections_Generic_KeyValuePairWrap.cs
│ │ │ ├── System_Collections_Generic_KeyValuePairWrap.cs.meta
│ │ │ ├── System_Collections_Generic_ListWrap.cs
│ │ │ ├── System_Collections_Generic_ListWrap.cs.meta
│ │ │ ├── System_Collections_IEnumeratorWrap.cs
│ │ │ ├── System_Collections_IEnumeratorWrap.cs.meta
│ │ │ ├── System_Collections_ObjectModel_ReadOnlyCollectionWrap.cs
│ │ │ ├── System_Collections_ObjectModel_ReadOnlyCollectionWrap.cs.meta
│ │ │ ├── System_DelegateWrap.cs
│ │ │ ├── System_DelegateWrap.cs.meta
│ │ │ ├── System_EnumWrap.cs
│ │ │ ├── System_EnumWrap.cs.meta
│ │ │ ├── System_NullObjectWrap.cs
│ │ │ ├── System_NullObjectWrap.cs.meta
│ │ │ ├── System_ObjectWrap.cs
│ │ │ ├── System_ObjectWrap.cs.meta
│ │ │ ├── System_StringWrap.cs
│ │ │ ├── System_StringWrap.cs.meta
│ │ │ ├── System_TypeWrap.cs
│ │ │ ├── System_TypeWrap.cs.meta
│ │ │ ├── UnityEngine_CoroutineWrap.cs
│ │ │ ├── UnityEngine_CoroutineWrap.cs.meta
│ │ │ ├── UnityEngine_ObjectWrap.cs
│ │ │ └── UnityEngine_ObjectWrap.cs.meta
│ │ ├── BaseType.meta
│ │ ├── Core/
│ │ │ ├── LuaAttributes.cs
│ │ │ ├── LuaAttributes.cs.meta
│ │ │ ├── LuaBaseRef.cs
│ │ │ ├── LuaBaseRef.cs.meta
│ │ │ ├── LuaBeatEvent.cs
│ │ │ ├── LuaBeatEvent.cs.meta
│ │ │ ├── LuaDLL.cs
│ │ │ ├── LuaDLL.cs.meta
│ │ │ ├── LuaEvent.cs
│ │ │ ├── LuaEvent.cs.meta
│ │ │ ├── LuaException.cs
│ │ │ ├── LuaException.cs.meta
│ │ │ ├── LuaFileUtils.cs
│ │ │ ├── LuaFileUtils.cs.meta
│ │ │ ├── LuaFunction.cs
│ │ │ ├── LuaFunction.cs.meta
│ │ │ ├── LuaMatchType.cs
│ │ │ ├── LuaMatchType.cs.meta
│ │ │ ├── LuaMethodCache.cs
│ │ │ ├── LuaMethodCache.cs.meta
│ │ │ ├── LuaMisc.cs
│ │ │ ├── LuaMisc.cs.meta
│ │ │ ├── LuaStackOp.cs
│ │ │ ├── LuaStackOp.cs.meta
│ │ │ ├── LuaState.cs
│ │ │ ├── LuaState.cs.meta
│ │ │ ├── LuaStatePtr.cs
│ │ │ ├── LuaStatePtr.cs.meta
│ │ │ ├── LuaStatic.cs
│ │ │ ├── LuaStatic.cs.meta
│ │ │ ├── LuaTable.cs
│ │ │ ├── LuaTable.cs.meta
│ │ │ ├── LuaThread.cs
│ │ │ ├── LuaThread.cs.meta
│ │ │ ├── LuaUnityLibs.cs
│ │ │ ├── LuaUnityLibs.cs.meta
│ │ │ ├── LuaValueType.cs
│ │ │ ├── LuaValueType.cs.meta
│ │ │ ├── ObjectPool.cs
│ │ │ ├── ObjectPool.cs.meta
│ │ │ ├── ObjectTranslator.cs
│ │ │ ├── ObjectTranslator.cs.meta
│ │ │ ├── ToLua.cs
│ │ │ ├── ToLua.cs.meta
│ │ │ ├── TypeChecker.cs
│ │ │ ├── TypeChecker.cs.meta
│ │ │ ├── TypeTraits.cs
│ │ │ └── TypeTraits.cs.meta
│ │ ├── Core.meta
│ │ ├── Editor/
│ │ │ ├── Extend/
│ │ │ │ ├── ToLua_LuaInterface_EventObject.cs
│ │ │ │ ├── ToLua_LuaInterface_EventObject.cs.meta
│ │ │ │ ├── ToLua_LuaInterface_LuaConstructor.cs
│ │ │ │ ├── ToLua_LuaInterface_LuaConstructor.cs.meta
│ │ │ │ ├── ToLua_LuaInterface_LuaField.cs
│ │ │ │ ├── ToLua_LuaInterface_LuaField.cs.meta
│ │ │ │ ├── ToLua_LuaInterface_LuaMethod.cs
│ │ │ │ ├── ToLua_LuaInterface_LuaMethod.cs.meta
│ │ │ │ ├── ToLua_LuaInterface_LuaProperty.cs
│ │ │ │ ├── ToLua_LuaInterface_LuaProperty.cs.meta
│ │ │ │ ├── ToLua_System_Delegate.cs
│ │ │ │ ├── ToLua_System_Delegate.cs.meta
│ │ │ │ ├── ToLua_System_Enum.cs
│ │ │ │ ├── ToLua_System_Enum.cs.meta
│ │ │ │ ├── ToLua_System_Object.cs
│ │ │ │ ├── ToLua_System_Object.cs.meta
│ │ │ │ ├── ToLua_System_String.cs
│ │ │ │ ├── ToLua_System_String.cs.meta
│ │ │ │ ├── ToLua_System_Type.cs
│ │ │ │ ├── ToLua_System_Type.cs.meta
│ │ │ │ ├── ToLua_UnityEngine_GameObject.cs
│ │ │ │ ├── ToLua_UnityEngine_GameObject.cs.meta
│ │ │ │ ├── ToLua_UnityEngine_Input.cs
│ │ │ │ ├── ToLua_UnityEngine_Input.cs.meta
│ │ │ │ ├── ToLua_UnityEngine_Object.cs
│ │ │ │ ├── ToLua_UnityEngine_Object.cs.meta
│ │ │ │ ├── ToLua_UnityEngine_RectTransform.cs
│ │ │ │ └── ToLua_UnityEngine_RectTransform.cs.meta
│ │ │ ├── Extend.meta
│ │ │ ├── ToLuaExport.cs
│ │ │ ├── ToLuaExport.cs.meta
│ │ │ ├── ToLuaMenu.cs
│ │ │ ├── ToLuaMenu.cs.meta
│ │ │ ├── ToLuaTree.cs
│ │ │ └── ToLuaTree.cs.meta
│ │ ├── Editor.meta
│ │ ├── Examples/
│ │ │ ├── 01_HelloWorld/
│ │ │ │ ├── HelloWorld.cs
│ │ │ │ ├── HelloWorld.cs.meta
│ │ │ │ ├── HelloWorld.unity
│ │ │ │ └── HelloWorld.unity.meta
│ │ │ ├── 01_HelloWorld.meta
│ │ │ ├── 02_ScriptsFromFile/
│ │ │ │ ├── ScriptsFromFile.cs
│ │ │ │ ├── ScriptsFromFile.cs.meta
│ │ │ │ ├── ScriptsFromFile.lua
│ │ │ │ ├── ScriptsFromFile.lua.meta
│ │ │ │ ├── ScriptsFromFile.unity
│ │ │ │ └── ScriptsFromFile.unity.meta
│ │ │ ├── 02_ScriptsFromFile.meta
│ │ │ ├── 03_CallLuaFunction/
│ │ │ │ ├── CallLuaFunction.cs
│ │ │ │ ├── CallLuaFunction.cs.meta
│ │ │ │ ├── CallLuaFunction.unity
│ │ │ │ └── CallLuaFunction.unity.meta
│ │ │ ├── 03_CallLuaFunction.meta
│ │ │ ├── 04_AccessingLuaVariables/
│ │ │ │ ├── AccessingLuaVariables.cs
│ │ │ │ ├── AccessingLuaVariables.cs.meta
│ │ │ │ ├── AccessingLuaVariables.unity
│ │ │ │ └── AccessingLuaVariables.unity.meta
│ │ │ ├── 04_AccessingLuaVariables.meta
│ │ │ ├── 05_LuaCoroutine/
│ │ │ │ ├── LuaCoroutine.unity
│ │ │ │ ├── LuaCoroutine.unity.meta
│ │ │ │ ├── TestCoroutine.cs
│ │ │ │ └── TestCoroutine.cs.meta
│ │ │ ├── 05_LuaCoroutine.meta
│ │ │ ├── 06_LuaCoroutine2/
│ │ │ │ ├── Coroutine.unity
│ │ │ │ ├── Coroutine.unity.meta
│ │ │ │ ├── TestCoroutine2.cs
│ │ │ │ └── TestCoroutine2.cs.meta
│ │ │ ├── 06_LuaCoroutine2.meta
│ │ │ ├── 07_LuaThread/
│ │ │ │ ├── TestLuaThread.cs
│ │ │ │ ├── TestLuaThread.cs.meta
│ │ │ │ ├── TestThread.unity
│ │ │ │ └── TestThread.unity.meta
│ │ │ ├── 07_LuaThread.meta
│ │ │ ├── 08_AccessingArray/
│ │ │ │ ├── AccessingArray.cs
│ │ │ │ ├── AccessingArray.cs.meta
│ │ │ │ ├── AccessingArray.unity
│ │ │ │ └── AccessingArray.unity.meta
│ │ │ ├── 08_AccessingArray.meta
│ │ │ ├── 09_Dictionary/
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccountWrap.cs
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccountWrap.cs.meta
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccount_KeyCollectionWrap.cs
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccount_KeyCollectionWrap.cs.meta
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccount_ValueCollectionWrap.cs
│ │ │ │ ├── System_Collections_Generic_Dictionary_int_TestAccount_ValueCollectionWrap.cs.meta
│ │ │ │ ├── System_Collections_Generic_KeyValuePair_int_TestAccountWrap.cs
│ │ │ │ ├── System_Collections_Generic_KeyValuePair_int_TestAccountWrap.cs.meta
│ │ │ │ ├── TestAccountWrap.cs
│ │ │ │ ├── TestAccountWrap.cs.meta
│ │ │ │ ├── UseDictionary.cs
│ │ │ │ ├── UseDictionary.cs.meta
│ │ │ │ ├── UseDictionary.unity
│ │ │ │ └── UseDictionary.unity.meta
│ │ │ ├── 09_Dictionary.meta
│ │ │ ├── 10_Enum/
│ │ │ │ ├── AccessingEnum.cs
│ │ │ │ ├── AccessingEnum.cs.meta
│ │ │ │ ├── AccessingEnum.unity
│ │ │ │ └── AccessingEnum.unity.meta
│ │ │ ├── 10_Enum.meta
│ │ │ ├── 11_Delegate/
│ │ │ │ ├── TestDelegate.cs
│ │ │ │ ├── TestDelegate.cs.meta
│ │ │ │ ├── TestEventListener.cs
│ │ │ │ ├── TestEventListener.cs.meta
│ │ │ │ ├── TestEventListenerWrap.cs
│ │ │ │ ├── TestEventListenerWrap.cs.meta
│ │ │ │ ├── UseDelegate.unity
│ │ │ │ └── UseDelegate.unity.meta
│ │ │ ├── 11_Delegate.meta
│ │ │ ├── 12_GameObject/
│ │ │ │ ├── TestGameObject.cs
│ │ │ │ ├── TestGameObject.cs.meta
│ │ │ │ ├── TestGameObject.unity
│ │ │ │ └── TestGameObject.unity.meta
│ │ │ ├── 12_GameObject.meta
│ │ │ ├── 13_CustomLoader/
│ │ │ │ ├── CustomLoader.unity
│ │ │ │ ├── CustomLoader.unity.meta
│ │ │ │ ├── TestCustomLoader.cs
│ │ │ │ └── TestCustomLoader.cs.meta
│ │ │ ├── 13_CustomLoader.meta
│ │ │ ├── 14_Out/
│ │ │ │ ├── TestOut.unity
│ │ │ │ ├── TestOut.unity.meta
│ │ │ │ ├── TestOutArg.cs
│ │ │ │ └── TestOutArg.cs.meta
│ │ │ ├── 14_Out.meta
│ │ │ ├── 15_ProtoBuffer/
│ │ │ │ ├── ProtoBuffer.unity
│ │ │ │ ├── ProtoBuffer.unity.meta
│ │ │ │ ├── TestProtoBuffer.cs
│ │ │ │ ├── TestProtoBuffer.cs.meta
│ │ │ │ ├── TestProtol.cs
│ │ │ │ ├── TestProtol.cs.meta
│ │ │ │ ├── TestProtolWrap.cs
│ │ │ │ ├── TestProtolWrap.cs.meta
│ │ │ │ ├── common.proto
│ │ │ │ ├── common.proto.meta
│ │ │ │ ├── person.proto
│ │ │ │ └── person.proto.meta
│ │ │ ├── 15_ProtoBuffer.meta
│ │ │ ├── 16_Int64/
│ │ │ │ ├── TestInt64.cs
│ │ │ │ ├── TestInt64.cs.meta
│ │ │ │ ├── TestInt64.unity
│ │ │ │ └── TestInt64.unity.meta
│ │ │ ├── 16_Int64.meta
│ │ │ ├── 17_Inherit/
│ │ │ │ ├── Inherit.unity
│ │ │ │ ├── Inherit.unity.meta
│ │ │ │ ├── TestInherit.cs
│ │ │ │ └── TestInherit.cs.meta
│ │ │ ├── 17_Inherit.meta
│ │ │ ├── 18_Bundle/
│ │ │ │ ├── TesetAssetBundle.unity
│ │ │ │ ├── TesetAssetBundle.unity.meta
│ │ │ │ ├── TestABLoader.cs
│ │ │ │ └── TestABLoader.cs.meta
│ │ │ ├── 18_Bundle.meta
│ │ │ ├── 19_cjson/
│ │ │ │ ├── TestCJson.cs
│ │ │ │ ├── TestCJson.cs.meta
│ │ │ │ ├── testcjson.unity
│ │ │ │ └── testcjson.unity.meta
│ │ │ ├── 19_cjson.meta
│ │ │ ├── 20_utf8/
│ │ │ │ ├── TestUTF8.cs
│ │ │ │ ├── TestUTF8.cs.meta
│ │ │ │ ├── utf8.unity
│ │ │ │ └── utf8.unity.meta
│ │ │ ├── 20_utf8.meta
│ │ │ ├── 21_String/
│ │ │ │ ├── TestString.cs
│ │ │ │ ├── TestString.cs.meta
│ │ │ │ ├── TestString.unity
│ │ │ │ └── TestString.unity.meta
│ │ │ ├── 21_String.meta
│ │ │ ├── 22_Reflection/
│ │ │ │ ├── TestReflection.cs
│ │ │ │ ├── TestReflection.cs.meta
│ │ │ │ ├── TestReflection.unity
│ │ │ │ └── TestReflection.unity.meta
│ │ │ ├── 22_Reflection.meta
│ │ │ ├── 23_List/
│ │ │ │ ├── UseList.cs
│ │ │ │ ├── UseList.cs.meta
│ │ │ │ ├── UseList.unity
│ │ │ │ └── UseList.unity.meta
│ │ │ ├── 23_List.meta
│ │ │ ├── 24_Struct/
│ │ │ │ ├── PassStruct.cs
│ │ │ │ ├── PassStruct.cs.meta
│ │ │ │ ├── Struct.unity
│ │ │ │ └── Struct.unity.meta
│ │ │ ├── 24_Struct.meta
│ │ │ ├── Performance/
│ │ │ │ ├── Performance.unity
│ │ │ │ ├── Performance.unity.meta
│ │ │ │ ├── TestPerformance.cs
│ │ │ │ └── TestPerformance.cs.meta
│ │ │ ├── Performance.meta
│ │ │ ├── README.md
│ │ │ ├── README.md.meta
│ │ │ ├── Resources/
│ │ │ │ ├── Lua/
│ │ │ │ │ ├── Protol/
│ │ │ │ │ │ ├── common_pb.lua.bytes
│ │ │ │ │ │ ├── common_pb.lua.bytes.meta
│ │ │ │ │ │ ├── person_pb.lua.bytes
│ │ │ │ │ │ └── person_pb.lua.bytes.meta
│ │ │ │ │ ├── Protol.meta
│ │ │ │ │ ├── TestErrorStack.lua.bytes
│ │ │ │ │ ├── TestErrorStack.lua.bytes.meta
│ │ │ │ │ ├── TestLoader.lua.bytes
│ │ │ │ │ ├── TestLoader.lua.bytes.meta
│ │ │ │ │ ├── TestLuaCoroutine.lua.bytes
│ │ │ │ │ ├── TestLuaCoroutine.lua.bytes.meta
│ │ │ │ │ ├── TestPerf.lua.bytes
│ │ │ │ │ ├── TestPerf.lua.bytes.meta
│ │ │ │ │ ├── ToLuaInjectionTestInjector.lua.bytes
│ │ │ │ │ └── ToLuaInjectionTestInjector.lua.bytes.meta
│ │ │ │ ├── Lua.meta
│ │ │ │ ├── jsonexample.json
│ │ │ │ └── jsonexample.json.meta
│ │ │ ├── Resources.meta
│ │ │ ├── TestErrorStack/
│ │ │ │ ├── TestInstantiate.cs
│ │ │ │ ├── TestInstantiate.cs.meta
│ │ │ │ ├── TestInstantiate.prefab
│ │ │ │ ├── TestInstantiate.prefab.meta
│ │ │ │ ├── TestInstantiate2.cs
│ │ │ │ ├── TestInstantiate2.cs.meta
│ │ │ │ ├── TestInstantiate2.prefab
│ │ │ │ ├── TestInstantiate2.prefab.meta
│ │ │ │ ├── TestLuaStack.cs
│ │ │ │ ├── TestLuaStack.cs.meta
│ │ │ │ ├── TestLuaStack.unity
│ │ │ │ └── TestLuaStack.unity.meta
│ │ │ ├── TestErrorStack.meta
│ │ │ ├── TestInjection/
│ │ │ │ ├── BaseTestWrap.cs
│ │ │ │ ├── BaseTestWrap.cs.meta
│ │ │ │ ├── TestInjection.cs
│ │ │ │ ├── TestInjection.cs.meta
│ │ │ │ ├── TestInjection.unity
│ │ │ │ ├── TestInjection.unity.meta
│ │ │ │ ├── ToLuaInjectionTest.cs
│ │ │ │ ├── ToLuaInjectionTest.cs.meta
│ │ │ │ ├── ToLuaInjectionTestWrap.cs
│ │ │ │ └── ToLuaInjectionTestWrap.cs.meta
│ │ │ ├── TestInjection.meta
│ │ │ ├── TestOverload/
│ │ │ │ ├── TestExportWrap.cs
│ │ │ │ ├── TestExportWrap.cs.meta
│ │ │ │ ├── TestExport_SpaceWrap.cs
│ │ │ │ ├── TestExport_SpaceWrap.cs.meta
│ │ │ │ ├── TestOverload.cs
│ │ │ │ ├── TestOverload.cs.meta
│ │ │ │ ├── TestOverload.unity
│ │ │ │ └── TestOverload.unity.meta
│ │ │ └── TestOverload.meta
│ │ ├── Examples.meta
│ │ ├── Injection/
│ │ │ ├── Editor/
│ │ │ │ ├── CustomCecilRocks/
│ │ │ │ │ ├── MethodBodyRocks.cs
│ │ │ │ │ └── MethodBodyRocks.cs.meta
│ │ │ │ ├── CustomCecilRocks.meta
│ │ │ │ ├── ToLuaInjection.cs
│ │ │ │ ├── ToLuaInjection.cs.meta
│ │ │ │ ├── ToLuaInjectionHelper.cs
│ │ │ │ ├── ToLuaInjectionHelper.cs.meta
│ │ │ │ ├── ToLuaText.cs
│ │ │ │ ├── ToLuaText.cs.meta
│ │ │ │ ├── ToluaInjectionBlackListPanel.cs
│ │ │ │ └── ToluaInjectionBlackListPanel.cs.meta
│ │ │ ├── Editor.meta
│ │ │ ├── InjectionBlackList.txt
│ │ │ ├── InjectionBlackList.txt.meta
│ │ │ ├── InjectionBridgeEditorInfo.xml
│ │ │ ├── InjectionBridgeEditorInfo.xml.meta
│ │ │ ├── LuaInjectionSkipPaths.txt
│ │ │ ├── LuaInjectionSkipPaths.txt.meta
│ │ │ ├── LuaInjectionStation.cs
│ │ │ └── LuaInjectionStation.cs.meta
│ │ ├── Injection.meta
│ │ ├── Lua/
│ │ │ ├── Build.bat
│ │ │ ├── Build.bat.meta
│ │ │ ├── System/
│ │ │ │ ├── Injection/
│ │ │ │ │ ├── InjectionBridgeInfo.lua
│ │ │ │ │ ├── InjectionBridgeInfo.lua.meta
│ │ │ │ │ ├── LuaInjectionBus.lua
│ │ │ │ │ ├── LuaInjectionBus.lua.meta
│ │ │ │ │ ├── LuaInjectionStation.lua
│ │ │ │ │ └── LuaInjectionStation.lua.meta
│ │ │ │ ├── Injection.meta
│ │ │ │ ├── Reflection/
│ │ │ │ │ ├── BindingFlags.lua
│ │ │ │ │ └── BindingFlags.lua.meta
│ │ │ │ ├── Reflection.meta
│ │ │ │ ├── Timer.lua
│ │ │ │ ├── Timer.lua.meta
│ │ │ │ ├── ValueType.lua
│ │ │ │ ├── ValueType.lua.meta
│ │ │ │ ├── coroutine.lua
│ │ │ │ └── coroutine.lua.meta
│ │ │ ├── System.meta
│ │ │ ├── UnityEngine/
│ │ │ │ ├── Bounds.lua
│ │ │ │ ├── Bounds.lua.meta
│ │ │ │ ├── Color.lua
│ │ │ │ ├── Color.lua.meta
│ │ │ │ ├── Color32.lua
│ │ │ │ ├── Color32.lua.meta
│ │ │ │ ├── LayerMask.lua
│ │ │ │ ├── LayerMask.lua.meta
│ │ │ │ ├── Mathf.lua
│ │ │ │ ├── Mathf.lua.meta
│ │ │ │ ├── Plane.lua
│ │ │ │ ├── Plane.lua.meta
│ │ │ │ ├── Profiler.lua
│ │ │ │ ├── Profiler.lua.meta
│ │ │ │ ├── Quaternion.lua
│ │ │ │ ├── Quaternion.lua.meta
│ │ │ │ ├── Ray.lua
│ │ │ │ ├── Ray.lua.meta
│ │ │ │ ├── RaycastHit.lua
│ │ │ │ ├── RaycastHit.lua.meta
│ │ │ │ ├── Time.lua
│ │ │ │ ├── Time.lua.meta
│ │ │ │ ├── Touch.lua
│ │ │ │ ├── Touch.lua.meta
│ │ │ │ ├── Vector2.lua
│ │ │ │ ├── Vector2.lua.meta
│ │ │ │ ├── Vector3.lua
│ │ │ │ ├── Vector3.lua.meta
│ │ │ │ ├── Vector4.lua
│ │ │ │ └── Vector4.lua.meta
│ │ │ ├── UnityEngine.meta
│ │ │ ├── cjson/
│ │ │ │ ├── util.lua
│ │ │ │ └── util.lua.meta
│ │ │ ├── cjson.meta
│ │ │ ├── event.lua
│ │ │ ├── event.lua.meta
│ │ │ ├── jit/
│ │ │ │ ├── bc.lua
│ │ │ │ ├── bc.lua.meta
│ │ │ │ ├── bcsave.lua
│ │ │ │ ├── bcsave.lua.meta
│ │ │ │ ├── dis_arm.lua
│ │ │ │ ├── dis_arm.lua.meta
│ │ │ │ ├── dis_arm64.lua
│ │ │ │ ├── dis_arm64.lua.meta
│ │ │ │ ├── dis_arm64be.lua
│ │ │ │ ├── dis_arm64be.lua.meta
│ │ │ │ ├── dis_mips.lua
│ │ │ │ ├── dis_mips.lua.meta
│ │ │ │ ├── dis_mips64.lua
│ │ │ │ ├── dis_mips64.lua.meta
│ │ │ │ ├── dis_mips64el.lua
│ │ │ │ ├── dis_mips64el.lua.meta
│ │ │ │ ├── dis_mipsel.lua
│ │ │ │ ├── dis_mipsel.lua.meta
│ │ │ │ ├── dis_ppc.lua
│ │ │ │ ├── dis_ppc.lua.meta
│ │ │ │ ├── dis_x64.lua
│ │ │ │ ├── dis_x64.lua.meta
│ │ │ │ ├── dis_x86.lua
│ │ │ │ ├── dis_x86.lua.meta
│ │ │ │ ├── dump.lua
│ │ │ │ ├── dump.lua.meta
│ │ │ │ ├── p.lua
│ │ │ │ ├── p.lua.meta
│ │ │ │ ├── v.lua
│ │ │ │ ├── v.lua.meta
│ │ │ │ ├── zone.lua
│ │ │ │ └── zone.lua.meta
│ │ │ ├── jit.meta
│ │ │ ├── list.lua
│ │ │ ├── list.lua.meta
│ │ │ ├── lpeg/
│ │ │ │ ├── re.lua
│ │ │ │ └── re.lua.meta
│ │ │ ├── lpeg.meta
│ │ │ ├── ltn12.lua
│ │ │ ├── ltn12.lua.meta
│ │ │ ├── mime.lua
│ │ │ ├── mime.lua.meta
│ │ │ ├── misc/
│ │ │ │ ├── functions.lua
│ │ │ │ ├── functions.lua.meta
│ │ │ │ ├── strict.lua
│ │ │ │ ├── strict.lua.meta
│ │ │ │ ├── utf8.lua
│ │ │ │ └── utf8.lua.meta
│ │ │ ├── misc.meta
│ │ │ ├── pbc.meta
│ │ │ ├── protobuf/
│ │ │ │ ├── containers.lua
│ │ │ │ ├── containers.lua.meta
│ │ │ │ ├── decoder.lua
│ │ │ │ ├── decoder.lua.meta
│ │ │ │ ├── descriptor.lua
│ │ │ │ ├── descriptor.lua.meta
│ │ │ │ ├── encoder.lua
│ │ │ │ ├── encoder.lua.meta
│ │ │ │ ├── listener.lua
│ │ │ │ ├── listener.lua.meta
│ │ │ │ ├── protobuf.lua
│ │ │ │ ├── protobuf.lua.meta
│ │ │ │ ├── text_format.lua
│ │ │ │ ├── text_format.lua.meta
│ │ │ │ ├── type_checkers.lua
│ │ │ │ ├── type_checkers.lua.meta
│ │ │ │ ├── wire_format.lua
│ │ │ │ └── wire_format.lua.meta
│ │ │ ├── protobuf.meta
│ │ │ ├── slot.lua
│ │ │ ├── slot.lua.meta
│ │ │ ├── socket/
│ │ │ │ ├── ftp.lua
│ │ │ │ ├── ftp.lua.meta
│ │ │ │ ├── headers.lua
│ │ │ │ ├── headers.lua.meta
│ │ │ │ ├── http.lua
│ │ │ │ ├── http.lua.meta
│ │ │ │ ├── mbox.lua
│ │ │ │ ├── mbox.lua.meta
│ │ │ │ ├── smtp.lua
│ │ │ │ ├── smtp.lua.meta
│ │ │ │ ├── tp.lua
│ │ │ │ ├── tp.lua.meta
│ │ │ │ ├── url.lua
│ │ │ │ └── url.lua.meta
│ │ │ ├── socket.lua
│ │ │ ├── socket.lua.meta
│ │ │ ├── socket.meta
│ │ │ ├── tolua.lua
│ │ │ ├── tolua.lua.meta
│ │ │ ├── typeof.lua
│ │ │ └── typeof.lua.meta
│ │ ├── Lua.meta
│ │ ├── Misc/
│ │ │ ├── LuaClient.cs
│ │ │ ├── LuaClient.cs.meta
│ │ │ ├── LuaCoroutine.cs
│ │ │ ├── LuaCoroutine.cs.meta
│ │ │ ├── LuaLooper.cs
│ │ │ ├── LuaLooper.cs.meta
│ │ │ ├── LuaProfiler.cs
│ │ │ ├── LuaProfiler.cs.meta
│ │ │ ├── LuaResLoader.cs
│ │ │ └── LuaResLoader.cs.meta
│ │ ├── Misc.meta
│ │ ├── Reflection/
│ │ │ ├── LuaConstructor.cs
│ │ │ ├── LuaConstructor.cs.meta
│ │ │ ├── LuaField.cs
│ │ │ ├── LuaField.cs.meta
│ │ │ ├── LuaMethod.cs
│ │ │ ├── LuaMethod.cs.meta
│ │ │ ├── LuaProperty.cs
│ │ │ ├── LuaProperty.cs.meta
│ │ │ ├── LuaReflection.cs
│ │ │ └── LuaReflection.cs.meta
│ │ ├── Reflection.meta
│ │ ├── readme.txt
│ │ └── readme.txt.meta
│ ├── ToLua.meta
│ ├── link.xml
│ └── link.xml.meta
├── LICENSE-tolua
├── Luajit/
│ ├── Build.bat
│ └── jit/
│ ├── bc.lua
│ ├── bcsave.lua
│ ├── dis_arm.lua
│ ├── dis_arm64.lua
│ ├── dis_arm64be.lua
│ ├── dis_mips.lua
│ ├── dis_mips64.lua
│ ├── dis_mips64el.lua
│ ├── dis_mipsel.lua
│ ├── dis_ppc.lua
│ ├── dis_x64.lua
│ ├── dis_x86.lua
│ ├── dump.lua
│ ├── p.lua
│ ├── v.lua
│ ├── vmdef.lua
│ └── zone.lua
├── Luajit64/
│ ├── Build.bat
│ └── jit/
│ ├── bc.lua
│ ├── bcsave.lua
│ ├── dis_arm.lua
│ ├── dis_arm64.lua
│ ├── dis_arm64be.lua
│ ├── dis_mips.lua
│ ├── dis_mips64.lua
│ ├── dis_mips64el.lua
│ ├── dis_mipsel.lua
│ ├── dis_ppc.lua
│ ├── dis_x64.lua
│ ├── dis_x86.lua
│ ├── dump.lua
│ ├── p.lua
│ ├── v.lua
│ ├── vmdef.lua
│ └── zone.lua
├── README-tolua.md
├── README.md
├── Tools/
│ ├── CSharpLua/
│ │ ├── CSharp.lua/
│ │ │ ├── CSharp.lua.Launcher.deps.json
│ │ │ ├── CSharp.lua.Launcher.pdb
│ │ │ ├── CSharp.lua.Launcher.runtimeconfig.json
│ │ │ ├── CSharp.lua.pdb
│ │ │ └── System.xml
│ │ ├── UnityEngine.xml
│ │ ├── codes/
│ │ │ └── All.lua
│ │ ├── disable_track.bat
│ │ ├── enable_track.bat
│ │ └── update_csharp.lua.cmd
│ └── ProtobufGen/
│ ├── protobuf-net/
│ │ ├── Licence.txt
│ │ ├── common.xslt
│ │ ├── csharp.xslt
│ │ ├── descriptor.proto
│ │ ├── protobuf-net.xml
│ │ ├── protoc-license.txt
│ │ ├── protogen.exe.config
│ │ ├── vb.xslt
│ │ └── xml.xslt
│ └── protogen.bat
└── Unity5.x/
└── Assets/
└── Plugins/
├── Android/
│ └── libs/
│ ├── armeabi-v7a/
│ │ └── libtolua.so.meta
│ └── x86/
│ └── libtolua.so.meta
├── iOS/
│ └── libtolua.a.meta
├── tolua.bundle.meta
├── x86/
│ └── tolua.dll.meta
└── x86_64/
└── tolua.dll.meta
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
/Assets/UnityVS.meta
/Assets/UnityVS
/UnityVS.tolua.v11.suo
/UnityVS.tolua.CSharp.csproj
/UnityVS.tolua.CSharp.Editor.csproj
/UnityVS.tolua.sln
.vs/
Packages
ProjectSettings
/Assets/Source/Generate
/Assets/CSharpLuaTemp
/Assets/CSharpLuaTemp.meta
/Assets/Lua/.idea/
/Assets/.lpproj
/Assets/ThirdParty/
/Assets/ThirdParty.meta
LuaDebuggee.dll
================================================
FILE: Assets/CSharpLua/Base/BaseScripts.asmdef
================================================
{
"name": "Base",
"references": [],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}
================================================
FILE: Assets/CSharpLua/Base/BaseScripts.asmdef.meta
================================================
fileFormatVersion: 2
guid: a74114e4c2e22e5439cffab27da66e88
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/BaseUtility.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace CSharpLua {
public interface IProvider {
void ConvertCustomMonoBehaviour(ref GameObject prefab);
}
public static class BaseUtility {
public static IProvider Provider { get; set; }
}
}
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/BaseUtility.cs.meta
================================================
fileFormatVersion: 2
guid: 926b10807f8340942925508454855bca
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/LuaAutoWrapAttribute.cs
================================================
using System;
///
/// 加入此标记,可以自动添加到导出列表
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct)]
public class LuaAutoWrapAttribute : Attribute {
public LuaAutoWrapAttribute() { }
}
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/LuaAutoWrapAttribute.cs.meta
================================================
fileFormatVersion: 2
guid: dafb7d14d4c87b74da4e18fb257c904d
timeCreated: 1526898161
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/Settings.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
namespace CSharpLua {
public static class Settings {
#if UNITY_EDITOR
public static class Paths {
public static readonly string CompiledScriptDir = Application.dataPath + "/CSharpLua/Compiled";
public static readonly string CompiledOutDir = Application.dataPath + "/Lua/Compiled";
public static readonly string ToolsDir = Application.dataPath + "/../Tools";
public const string kTempDir = "Assets/CSharpLuaTemp";
public const string kCompiledScripts = "Compiled";
public static readonly string SettingFilePath = Application.dataPath + "/CSharpLua/Base/CSharpLua/Settings.cs";
}
public static class Menus {
public const string kCompile = "CharpLua/Compile";
public const string kRunFromCSharp = "CharpLua/Switch to RunFromCSharp";
public const string kRunFromLua = "CharpLua/Swicth to RunFromLua";
public const string kGenProtobuf = "CharpLua/Gen protobuf";
}
#endif
public const bool kIsRunFromLua = true;
}
}
================================================
FILE: Assets/CSharpLua/Base/CSharpLua/Settings.cs.meta
================================================
fileFormatVersion: 2
guid: 3496baf3649572f44b1d70ef854e729f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Base/CSharpLua.meta
================================================
fileFormatVersion: 2
guid: 344556a0bba10b744aceb8f65773392e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Base.meta
================================================
fileFormatVersion: 2
guid: 58354dbb9d958af4399ff1a50246b611
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Bridge/BridgeScripts.asmdef
================================================
{
"name": "Bridge",
"references": [
"Base"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}
================================================
FILE: Assets/CSharpLua/Bridge/BridgeScripts.asmdef.meta
================================================
fileFormatVersion: 2
guid: 4c78da7caad00b44ea75ddb210bf7528
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Bridge/TestUtils.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEditor;
[LuaAutoWrap]
public sealed class TestUtils {
public static GameObject Load(string path) {
GameObject prefab = (GameObject)AssetDatabase.LoadMainAssetAtPath(path);
CSharpLua.BaseUtility.Provider.ConvertCustomMonoBehaviour(ref prefab);
return prefab;
}
}
================================================
FILE: Assets/CSharpLua/Bridge/TestUtils.cs.meta
================================================
fileFormatVersion: 2
guid: 0f7832487e5e88a47b620e14661a1e00
timeCreated: 1528447325
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Bridge.meta
================================================
fileFormatVersion: 2
guid: d5c23c299d89e9f47a02659740280a56
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/CSharpLuaClient.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using LuaInterface;
namespace CSharpLua {
[LuaAutoWrap]
public sealed class BridgeMonoBehaviour : MonoBehaviour {
private static readonly YieldInstruction[] updateYieldInstructions_ = new YieldInstruction[] { null, new WaitForFixedUpdate(), new WaitForEndOfFrame() };
public LuaTable Table { get; private set; }
public string LuaClass;
public string SerializeData;
public UnityEngine.Object[] SerializeObjects;
public void Bind(LuaTable table, string luaClass) {
Table = table;
LuaClass = luaClass;
}
public void Bind(LuaTable table) {
Table = table;
}
internal void Bind(string luaClass, string serializeData, UnityEngine.Object[] serializeObjects) {
LuaClass = luaClass;
SerializeData = serializeData;
SerializeObjects = serializeObjects;
}
public void RegisterUpdate(int instructionIndex, LuaFunction updateFn) {
StartCoroutine(StartUpdate(updateFn, updateYieldInstructions_[instructionIndex]));
}
private IEnumerator StartUpdate(LuaFunction updateFn, YieldInstruction yieldInstruction) {
while (true) {
yield return yieldInstruction;
updateFn.Call(Table);
}
}
private void Awake() {
if (!string.IsNullOrEmpty(LuaClass)) {
if (Table == null) {
Table = CSharpLuaClient.Instance.BindLua(this);
} else {
using (var fn = Table.GetLuaFunction("Awake")) {
fn.Call(Table);
}
}
}
}
private void Start() {
using (var fn = Table.GetLuaFunction("Start")) {
fn.Call(Table);
}
}
}
internal sealed class LuaIEnumerator : IEnumerator, IDisposable {
private LuaTable table_;
private LuaFunction current_;
private LuaFunction moveNext_;
private LuaIEnumerator(LuaTable table) {
table_ = table;
current_ = table.GetLuaFunction("getCurrent");
if (current_ == null) {
throw new ArgumentNullException();
}
moveNext_ = table.GetLuaFunction("MoveNext");
if (moveNext_ == null) {
throw new ArgumentNullException();
}
}
public static LuaIEnumerator Create(LuaTable table) {
var ret = table.GetTable("ref");
if (ret == null) {
ret = new LuaIEnumerator(table);
table.SetTable("ref", ret);
}
return ret;
}
public void Push(IntPtr L) {
table_.Push();
}
public object Current {
get {
object obj = current_.Invoke(table_);
var t = obj as LuaTable;
if (t != null && CSharpLuaClient.Instance.IsLuaIEnumerator(t)) {
return Create(t);
}
return obj;
}
}
public void Dispose() {
if (current_ != null) {
current_.Dispose();
current_ = null;
}
if (moveNext_ != null) {
moveNext_.Dispose();
moveNext_ = null;
}
if (table_ != null) {
table_.Dispose();
table_ = null;
}
}
public bool MoveNext() {
bool hasNext = moveNext_.Invoke(table_);
if (!hasNext) {
Dispose();
}
return hasNext;
}
public void Reset() {
throw new NotSupportedException();
}
}
public class CSharpLuaClient : LuaClient, IProvider {
public string[] Components;
private LuaFunction bindFn_;
private LuaFunction isIEnumeratorFn_;
public static new CSharpLuaClient Instance { get { return (CSharpLuaClient)LuaClient.Instance; } }
protected override void OpenLibs() {
base.OpenLibs();
OpenCJson();
OpenPBC();
}
private void OpenPBC() {
luaState.OpenLibs(LuaDLL.luaopen_protobuf_c);
}
public override void Destroy() {
if (bindFn_ != null) {
bindFn_.Dispose();
bindFn_ = null;
}
if (isIEnumeratorFn_ != null) {
isIEnumeratorFn_.Dispose();
isIEnumeratorFn_ = null;
}
base.Destroy();
BaseUtility.Provider = null;
}
protected override void StartMain() {
BaseUtility.Provider = this;
if (Settings.kIsRunFromLua) {
base.StartMain();
bindFn_ = luaState.GetFunction("UnityEngine.bind");
if (bindFn_ == null) {
throw new InvalidProgramException();
}
if (Components != null && Components.Length > 0) {
using (var fn = luaState.GetFunction("UnityEngine.addComponent")) {
foreach (string type in Components) {
fn.Call(gameObject, type);
}
}
}
} else {
#pragma warning disable 0162
if (Components != null) {
foreach (string type in Components) {
Type componentType = Type.GetType(type, true, false);
gameObject.AddComponent(componentType);
}
}
#pragma warning restore 0162
}
}
internal LuaTable BindLua(BridgeMonoBehaviour bridgeMonoBehaviour) {
return bindFn_.Invoke(
bridgeMonoBehaviour,
bridgeMonoBehaviour.LuaClass,
bridgeMonoBehaviour.SerializeData,
bridgeMonoBehaviour.SerializeObjects);
}
internal bool IsLuaIEnumerator(LuaTable t) {
if (isIEnumeratorFn_ == null) {
isIEnumeratorFn_ = luaState.GetFunction("System.IsIEnumerator");
if (isIEnumeratorFn_ == null) {
throw new InvalidProgramException();
}
}
return isIEnumeratorFn_.Invoke(t);
}
public void ConvertCustomMonoBehaviour(ref GameObject prefab) {
#if UNITY_EDITOR
if (Settings.kIsRunFromLua) {
UserMonoBehaviourConverter.Default.Do(ref prefab);
}
#endif
}
}
}
================================================
FILE: Assets/CSharpLua/CSharpLuaClient.cs.meta
================================================
fileFormatVersion: 2
guid: 1c379516c224fca4198f4de0962735e4
timeCreated: 1528271831
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/CompiledScripts.asmdef
================================================
{
"name": "Compiled",
"references": [
"Bridge"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}
================================================
FILE: Assets/CSharpLua/Compiled/CompiledScripts.asmdef.meta
================================================
fileFormatVersion: 2
guid: 55be9d1390aba8646b0237dae609af2e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/AutoGen/CommonPrototype.cs
================================================
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
// Generated from: CommonPrototype.proto
using System;
using System.Collections.Generic;
using ProtoBuf;
namespace CSharpLua.Project.Protocol
{
[ProtoContract]
public partial class SettingProto : IProtocol
{
[ProtoMember(1, DataFormat = DataFormat.Default)]
public List Values { get; set; } = new List();
[ProtoMember(2, IsRequired = true, DataFormat = DataFormat.TwosComplement)]
public int SettingsMark { get; set; }
[ProtoContract]
public partial class ValuePairProto : IProtocol
{
[ProtoMember(1, IsRequired = true, DataFormat = DataFormat.Default)]
public string Key { get; set; }
[ProtoMember(2, IsRequired = true, DataFormat = DataFormat.Default)]
public string Value { get; set; }
}
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/AutoGen/CommonPrototype.cs.meta
================================================
fileFormatVersion: 2
guid: 78debcec0b8758e4b9dbde7b10c1128a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/AutoGen.meta
================================================
fileFormatVersion: 2
guid: b7e6a6d4681331a47b4a8f5228a03018
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/CommonPrototype.proto
================================================
package CSharpLua.Project.Protocol;
message SettingProto {
message ValuePairProto {
required string Key = 1;
required string Value = 2;
}
repeated ValuePairProto Values = 1;
required int32 SettingsMark = 2;
}
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/CommonPrototype.proto.meta
================================================
fileFormatVersion: 2
guid: 07f5e97e19969f74dbd315423dbc49fb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/IProtocol.cs
================================================
namespace ProtoBuf {
public interface IProtocol {
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Protocol/IProtocol.cs.meta
================================================
fileFormatVersion: 2
guid: 3e84cedf7f75dd1488cd80392079610f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Protocol.meta
================================================
fileFormatVersion: 2
guid: e27d3b48940561d4b86687784d596098
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestCoroutine.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Sample {
public class TestCoroutine : MonoBehaviour {
private List list = new List();
public void Awake() {
Debug.Log("TestCoroutine");
StartCoroutine(OnTick());
print(gameObject.name);
print(list.Count);
StartCoroutine(T1());
}
private IEnumerator OnTick() {
while (true) {
yield return new WaitForSeconds(1);
print("TestCoroutine.OnTick");
}
}
public void Test() {
print("TestCoroutine.Test");
}
private IEnumerator T1() {
print("a0");
yield return null;
print("a1");
yield return T2();
print("a2");
}
private IEnumerator T2() {
print("b0");
yield return null;
print("b1");
yield return null;
print("b2");
}
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestCoroutine.cs.meta
================================================
fileFormatVersion: 2
guid: 729f6a41b84190a4ea3b9a09e6fa57a7
timeCreated: 1528274108
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestHangingScript.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Sample {
public class TestHangingScript : MonoBehaviour {
public string DataOfString;
public int DataOfInt;
public string DataOfString2 = "ddddd";
public int a = 10;
public GameObject DataOfGameObject;
public UnityEngine.Object DateOfObject;
public TestCoroutine HangingMonoBehaviour;
public List l = new List();
public Vector2 vector2;
public Vector3 vector3;
public void Awake() {
print("Awake");
print(DataOfString);
print(DataOfInt);
print(DataOfString2);
print(a);
print(HangingMonoBehaviour.name);
print(string.Join(",", l));
print($"{vector2}, {vector3}");
}
public void Start() {
print("Start");
}
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestHangingScript.cs.meta
================================================
fileFormatVersion: 2
guid: aa1fc193057764b49b4ef3ad042007cd
timeCreated: 1528274108
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestHelloWord.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Sample {
public sealed class TestHelloWord : MonoBehaviour {
public void Awake() {
Debug.Log("TestHelloWord");
gameObject.AddComponent();
var c = GetComponent();
print(c.name);
var obj1 = FindObjectOfType();
Destroy(obj1);
GameObject i = TestUtils.Load("Assets/CSharpLua/Examples/01_HelloWorld/TestLoader.prefab");
var obj = Instantiate(i);
obj.transform.parent = transform;
TestProtobuf.Run();
}
private void Start() {
print("TestHelloWord.Start");
}
private void Update() {
print("TestHelloWord.Update");
}
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestHelloWord.cs.meta
================================================
fileFormatVersion: 2
guid: d01266a3cb9c65446aff41f37bc14f67
timeCreated: 1528274108
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestProtobuf.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProtoBuf;
using CSharpLua.Project.Protocol;
using System.IO;
using ProtoBuf.Meta;
namespace Sample {
public static class TestProtobuf {
public static void Run() {
#if __CSharpLua__
/*
[[
protobuf.register_file("Assets/Lua/3rd/pbc/Protocol/CommonPrototype.pb")
]]
*/
#endif
SettingProto proto = new SettingProto() { SettingsMark = 101 };
proto.Values.Add(new SettingProto.ValuePairProto() { Key = "a", Value = "b" });
var bytes = Encode(proto);
var t = Decode(bytes);
UnityEngine.Debug.LogFormat("ProtobufDecode {0}", t.SettingsMark);
}
private static byte[] Encode(IProtocol proto) {
#if !__CSharpLua__
using (MemoryStream s = new MemoryStream()) {
RuntimeTypeModel.Default.Serialize(s, proto);
return s.ToArray();
}
#else
byte[] bytes = null;
/*
[[
bytes = encodeProtobuf(proto)
]]
*/
return bytes;
#endif
}
private static T Decode(byte[] bytes) where T : class {
#if !__CSharpLua__
using (MemoryStream s = new MemoryStream(bytes)) {
var t = (T)RuntimeTypeModel.Default.Deserialize(s, null, typeof(T));
return t;
}
#else
T t = null;
/*
[[
t = decodeProtobuf(bytes, T)
]]
*/
return t;
#endif
}
}
}
================================================
FILE: Assets/CSharpLua/Compiled/Sample/TestProtobuf.cs.meta
================================================
fileFormatVersion: 2
guid: 702d00be8d6fcda448f17c8a3eecd43f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled/Sample.meta
================================================
fileFormatVersion: 2
guid: c756251f944f45b4f91b0d682a8e5811
folderAsset: yes
timeCreated: 1528272569
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Compiled.meta
================================================
fileFormatVersion: 2
guid: 30775760c22aaf9428e8d40b0574a998
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Editor/Compiler.cs
================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
namespace CSharpLua {
public static class Compiler {
private sealed class CompiledFail : Exception {
public CompiledFail(string message) : base(message) {
}
}
#if UNITY_EDITOR_WIN
private const string kDotnet = "dotnet";
#else
private const string kDotnet = "/usr/local/share/dotnet/dotnet";
#endif
private static readonly string compiledScriptDir_ = Settings.Paths.CompiledScriptDir;
private static readonly string outDir_ = Settings.Paths.CompiledOutDir;
private static readonly string csharpToolsDir_ = $"{Settings.Paths.ToolsDir}/CSharpLua";
private static readonly string csharpLua_ = $"{csharpToolsDir_}/CSharp.lua/CSharp.lua.Launcher.dll";
private static readonly string genProtobuf = $"{Settings.Paths.ToolsDir}/ProtobufGen/protogen.bat";
private static readonly string settingFilePath_ = Settings.Paths.SettingFilePath;
[MenuItem(Settings.Menus.kCompile)]
public static void Compile() {
if (!CheckDotnetInstall()) {
return;
}
if (!File.Exists(csharpLua_)) {
throw new InvalidProgramException($"{csharpLua_} not found");
}
var outDirectoryInfo = new DirectoryInfo(outDir_);
if (outDirectoryInfo.Exists) {
foreach (var luaFile in outDirectoryInfo.EnumerateFiles("*.lua", SearchOption.AllDirectories)) {
luaFile.Delete();
}
}
HashSet libs = new HashSet();
FillUnityLibraries(libs);
AssemblyName assemblyName = new AssemblyName(Settings.Paths.kCompiledScripts);
Assembly assembly = Assembly.Load(assemblyName);
foreach (var referenced in assembly.GetReferencedAssemblies()) {
if (referenced.Name != "mscorlib" && !referenced.Name.StartsWith("System")) {
string libPath = Assembly.Load(referenced).Location;
libs.Add(libPath);
}
}
string[] metas = new string[] { $"{csharpToolsDir_}/UnityEngine.xml" };
string lib = string.Join(";", libs.ToArray());
string meta = string.Join(";", metas);
string args = $"{csharpLua_} -s \"{compiledScriptDir_}\" -d \"{outDir_}\" -l \"{lib}\" -m {meta} -c";
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
if (!string.IsNullOrEmpty(definesString)) {
args += $" -csc -define:{definesString}";
}
var info = new ProcessStartInfo() {
FileName = kDotnet,
Arguments = args,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8,
};
using (var p = Process.Start(info)) {
var output = new StringBuilder();
var error = new StringBuilder();
p.OutputDataReceived += (sender, eventArgs) => output.AppendLine(eventArgs.Data);
p.ErrorDataReceived += (sender, eventArgs) => error.AppendLine(eventArgs.Data);
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.WaitForExit();
if (p.ExitCode == 0) {
UnityEngine.Debug.Log(output);
} else {
throw new CompiledFail($"Compile fail, {error}\n{output}\n{kDotnet} {args}");
}
}
}
private static void FillUnityLibraries(HashSet libs) {
string unityObjectPath = typeof(UnityEngine.Object).Assembly.Location;
string baseDir = Path.GetDirectoryName(unityObjectPath);
foreach (string path in Directory.EnumerateFiles(baseDir, "*.dll")) {
libs.Add(path);
}
}
private static bool CheckDotnetInstall() {
bool has = InternalCheckDotnetInstall();
if (!has) {
UnityEngine.Debug.LogWarning("not found dotnet");
if (EditorUtility.DisplayDialog(".NET未安装", "未安装.NET 5.0运行环境,点击确定前往安装", "确定", "取消")) {
Application.OpenURL("https://dotnet.microsoft.com/download/dotnet/5.0");
}
}
return has;
}
private static bool InternalCheckDotnetInstall() {
var info = new ProcessStartInfo() {
FileName = kDotnet,
Arguments = "--version",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8,
};
try {
using (var p = Process.Start(info)) {
p.WaitForExit();
if (p.ExitCode == 0) {
string version = p.StandardOutput.ReadToEnd();
UnityEngine.Debug.LogFormat("found dotnet {0}", version);
int major = version[0] - '0';
if (major >= 5) {
return true;
} else {
UnityEngine.Debug.LogErrorFormat("dotnet verson {0} must >= 5.0", version);
}
}
return false;
}
} catch (Exception e) {
UnityEngine.Debug.LogException(e);
return false;
}
}
[MenuItem(Settings.kIsRunFromLua ? Settings.Menus.kRunFromCSharp : Settings.Menus.kRunFromLua)]
public static void Switch() {
#if UNITY_2018_1_OR_NEWER
const string kFieldName = nameof(Settings.kIsRunFromLua);
#else
const string kFieldName = "kIsRunFromLua";
#endif
string text = File.ReadAllText(settingFilePath_);
int begin = text.IndexOf(kFieldName);
if (begin != -1) {
int end = text.IndexOf(';', begin + kFieldName.Length);
if (end != -1) {
string s = text.Substring(begin, end - begin);
string[] array = s.Split('=');
bool v = bool.Parse(array[1]);
string replace = kFieldName + " = " + (v ? "false" : "true");
text = text.Replace(s, replace);
File.WriteAllText(settingFilePath_, text);
AssetDatabase.Refresh();
} else {
throw new InvalidProgramException($"field {kFieldName} not found end symbol in {settingFilePath_}");
}
} else {
throw new InvalidProgramException($"not found field {kFieldName} in {settingFilePath_}");
}
}
[MenuItem(Settings.Menus.kGenProtobuf)]
public static void GenProtobuf() {
var info = new ProcessStartInfo() {
FileName = genProtobuf,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8,
WorkingDirectory = $"{Settings.Paths.ToolsDir}/ProtobufGen/",
};
var p = Process.Start(info);
p.OutputDataReceived += (sender, eventArgs) => {
if (!string.IsNullOrEmpty(eventArgs.Data)) {
UnityEngine.Debug.Log(eventArgs.Data);
}
};
p.ErrorDataReceived += (sender, eventArgs) => {
if (!string.IsNullOrEmpty(eventArgs.Data)) {
UnityEngine.Debug.LogError(eventArgs.Data);
}
};
p.BeginOutputReadLine();
p.BeginErrorReadLine();
}
}
#if UNITY_2018_1_OR_NEWER
[InitializeOnLoad]
public class EditorQuitHandler {
static void Quit() {
string tempDir = Settings.Paths.kTempDir;
if (Directory.Exists(tempDir)) {
Directory.Delete(tempDir, true);
}
}
static EditorQuitHandler() {
EditorApplication.quitting += Quit;
}
}
#endif
}
================================================
FILE: Assets/CSharpLua/Editor/Compiler.cs.meta
================================================
fileFormatVersion: 2
guid: 59c6d8baca17a7146b763b1e4fa394d6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Editor.meta
================================================
fileFormatVersion: 2
guid: 4fe6f8ae96df5fd45bf9bbab5cb9a8e7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Examples/01_HelloWorld/HelloWorld.unity.meta
================================================
fileFormatVersion: 2
guid: 44e8c9b1935171746b04903a251c413d
timeCreated: 1526899852
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Examples/01_HelloWorld/TestLoader.prefab.meta
================================================
fileFormatVersion: 2
guid: 20c93afce42002a41a008ca942ccb69d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Examples/01_HelloWorld/testText.txt
================================================
hello,word
================================================
FILE: Assets/CSharpLua/Examples/01_HelloWorld/testText.txt.meta
================================================
fileFormatVersion: 2
guid: a0ac40db8f690ec43aeb9ee683d170f6
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Examples/01_HelloWorld.meta
================================================
fileFormatVersion: 2
guid: e64303adce0f8d8438e46552eb0f8b84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/Examples.meta
================================================
fileFormatVersion: 2
guid: 19a7a8aa535d0de4ba63cd62704e83f6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/CSharpLua/UserMonoBehaviourConverter.cs
================================================
#if UNITY_EDITOR
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using UnityEngine;
using UnityEditor;
using LuaInterface;
namespace CSharpLua {
public sealed class UserMonoBehaviourConverter {
private sealed class StructField {
private string s_;
public bool HasField { get; set; }
public StructField(object v) {
StringBuilder sb = new StringBuilder();
sb.Append('{');
Type t = v.GetType();
bool isFirst = true;
foreach (var field in t.GetFields(BindingFlags.Instance | BindingFlags.Public)) {
object x = field.GetValue(v);
if (x != null) {
var y = Activator.CreateInstance(x.GetType());
if (!x.EQ(y)) {
if (isFirst) {
isFirst = false;
} else {
sb.Append(',');
}
sb.Append(field.Name);
sb.Append('=');
sb.Append(SerializeFieldsInfo.NormalValueToString(x));
HasField = true;
}
}
}
sb.Append(',');
sb.Append(t.FullName);
sb.Append('}');
s_ = sb.ToString();
}
public override string ToString() {
return s_;
}
}
private sealed class SerializeFieldsInfo {
internal abstract class ObjectField {
public string Name;
public abstract void FillTo(StringBuilder sb);
}
internal sealed class PoolIndexObjectField : ObjectField {
public int PoolIndex;
public override void FillTo(StringBuilder sb) {
sb.Append(PoolIndex);
}
}
internal sealed class ArrayObjectField : ObjectField {
public bool IsArray;
public Type ElementType;
public List PoolIndexs = new List();
public override void FillTo(StringBuilder sb) {
string array = ToList(IsArray, ElementType, PoolIndexs, i => i.ToString());
sb.Append(array);
}
}
internal sealed class MonoBehaviourField {
public int PoolIndex;
public string ClassName;
}
public Dictionary Normals = new Dictionary();
public List ObjectsPool = new List();
public List Objects = new List();
public List MonoBehaviourFields = new List();
private void AppendNormals(StringBuilder sb) {
sb.Append('{');
bool isFirst = true;
foreach (var normal in Normals) {
if (isFirst) {
isFirst = false;
} else {
sb.Append(',');
}
sb.Append(normal.Key);
sb.Append('=');
sb.Append(ValueToString(normal.Value));
}
sb.Append("}");
}
private void AppendObjects(StringBuilder sb) {
if (Objects.Count > 0) {
sb.Append('{');
bool isFirst = true;
foreach (var field in Objects) {
if (isFirst) {
isFirst = false;
} else {
sb.Append(',');
}
sb.Append(field.Name);
sb.Append('=');
field.FillTo(sb);
}
sb.Append('}');
}
}
public string GetSerializeData() {
bool isEmpty = Normals.Count == 0 && Objects.Count == 0;
StringBuilder sb = new StringBuilder();
if (!isEmpty) {
sb.Append("return{");
AppendNormals(sb);
sb.Append(',');
AppendObjects(sb);
sb.Append('}');
}
return sb.ToString();
}
public UnityEngine.Object[] GetSerializeObjects() {
return ObjectsPool.Count > 0 ? ObjectsPool.ToArray() : null;
}
private static string ToList(bool isArray, Type elementType, IList list, Func