예제 #1
0
        static public LuaTable Load(string gameObjectName, string luaFilePath)
        {
            GameObject gameObject = new GameObject(gameObjectName);

            luaFilePathDic.Add(gameObject, luaFilePath);
            LuaBaseBehaviour luaBaseBehaviour = gameObject.AddComponent <LuaBaseBehaviour> ();

            luaBaseBehaviour.Init();
            return(luaBaseBehaviour.scriptEnv);
        }
예제 #2
0
        static LuaTable Add <T>(string gameObjectName, string luaFilePath) where T : LuaBaseBehaviour
        {
            GameObject gameObject = GameObject.Find(gameObjectName);

            LuaBaseBehaviour.luaFilePathDic.Add(gameObject, luaFilePath);
            LuaBaseBehaviour luaBaseBehaviour = gameObject.AddComponent <T> ();

            luaBaseBehaviour.Init();
            return(luaBaseBehaviour.scriptEnv);
        }
예제 #3
0
        static LuaTable LoadDontDestroy <T>(string gameObjectName, string luaFilePath) where T : LuaBaseBehaviour
        {
            GameObject gameObject = new GameObject(gameObjectName);

            GameObject.DontDestroyOnLoad(gameObject);

            LuaBaseBehaviour.luaFilePathDic.Add(gameObject, luaFilePath);
            LuaBaseBehaviour luaBaseBehaviour = gameObject.AddComponent <T> ();

            luaBaseBehaviour.Init();
            return(luaBaseBehaviour.scriptEnv);
        }