コード例 #1
0
ファイル: SceneLoader.cs プロジェクト: syougun360/CutTrees
    /// <summary>
    /// 読込開始
    /// </summary>
    /// <param name="id"></param>
    /// <param name="addtive"></param>
    /// <param name="async"></param>
    public SceneLoader(SceneDefine.SCENE_ID id, bool addtive, bool async)
    {
        SceneID      = id;
        Name         = SceneDefine.SceneNames[(int)id];
        this.addtive = addtive;
        this.async   = async;

        if (async)
        {
            var param = new UnityEngine.SceneManagement.LoadSceneParameters();
            if (addtive)
            {
                param.loadSceneMode = UnityEngine.SceneManagement.LoadSceneMode.Additive;
            }
            else
            {
                param.loadSceneMode = UnityEngine.SceneManagement.LoadSceneMode.Single;
            }

            asyncOperation = UnitySceneManager.LoadSceneAsync(Name, param);
        }
        else
        {
            if (addtive)
            {
                UnitySceneManager.LoadScene(Name, UnityEngine.SceneManagement.LoadSceneMode.Additive);
            }
            else
            {
                UnitySceneManager.LoadScene(Name, UnityEngine.SceneManagement.LoadSceneMode.Single);
            }
        }
    }
コード例 #2
0
    static int LoadScene(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes <int>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.SceneManagement.SceneManager.LoadScene(arg0);
                return(0);
            }
            else if (count == 1 && TypeChecker.CheckTypes <string>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.SceneManagement.SceneManager.LoadScene(arg0);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <int, UnityEngine.SceneManagement.LoadSceneMode>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)ToLua.ToObject(L, 2);
                UnityEngine.SceneManagement.SceneManager.LoadScene(arg0, arg1);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <int, UnityEngine.SceneManagement.LoadSceneParameters>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.SceneManagement.LoadSceneParameters arg1 = StackTraits <UnityEngine.SceneManagement.LoadSceneParameters> .To(L, 2);

                UnityEngine.SceneManagement.Scene o = UnityEngine.SceneManagement.SceneManager.LoadScene(arg0, arg1);
                ToLua.PushValue(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string, UnityEngine.SceneManagement.LoadSceneMode>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)ToLua.ToObject(L, 2);
                UnityEngine.SceneManagement.SceneManager.LoadScene(arg0, arg1);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string, UnityEngine.SceneManagement.LoadSceneParameters>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.SceneManagement.LoadSceneParameters arg1 = StackTraits <UnityEngine.SceneManagement.LoadSceneParameters> .To(L, 2);

                UnityEngine.SceneManagement.Scene o = UnityEngine.SceneManagement.SceneManager.LoadScene(arg0, arg1);
                ToLua.PushValue(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.SceneManagement.SceneManager.LoadScene"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.SceneManagement.LoadSceneParameters o;
         if (argc == 2)
         {
             UnityEngine.SceneManagement.LoadSceneMode a1;
             a1 = (UnityEngine.SceneManagement.LoadSceneMode)LuaDLL.luaL_checkinteger(l, 2);
             o  = new UnityEngine.SceneManagement.LoadSceneParameters(a1);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 3)
         {
             UnityEngine.SceneManagement.LoadSceneMode a1;
             a1 = (UnityEngine.SceneManagement.LoadSceneMode)LuaDLL.luaL_checkinteger(l, 2);
             UnityEngine.SceneManagement.LocalPhysicsMode a2;
             a2 = (UnityEngine.SceneManagement.LocalPhysicsMode)LuaDLL.luaL_checkinteger(l, 3);
             o  = new UnityEngine.SceneManagement.LoadSceneParameters(a1, a2);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 0)
         {
             o = new UnityEngine.SceneManagement.LoadSceneParameters();
             pushValue(l, true);
             pushObject(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static public int ctor_s(IntPtr l)
 {
     try {
         UnityEngine.SceneManagement.LoadSceneParameters o;
         o = new UnityEngine.SceneManagement.LoadSceneParameters();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int ctor__LoadSceneMode_s(IntPtr l)
 {
     try {
         UnityEngine.SceneManagement.LoadSceneParameters o;
         UnityEngine.SceneManagement.LoadSceneMode       a1;
         checkEnum(l, 1, out a1);
         o = new UnityEngine.SceneManagement.LoadSceneParameters(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.SceneManagement.LoadSceneParameters o;
         if (argc == 4)
         {
             UnityEngine.SceneManagement.LoadSceneMode a1;
             checkEnum(l, 3, out a1);
             UnityEngine.SceneManagement.LocalPhysicsMode a2;
             checkEnum(l, 4, out a2);
             o = new UnityEngine.SceneManagement.LoadSceneParameters(a1, a2);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 3)
         {
             UnityEngine.SceneManagement.LoadSceneMode a1;
             checkEnum(l, 3, out a1);
             o = new UnityEngine.SceneManagement.LoadSceneParameters(a1);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc <= 2)
         {
             o = new UnityEngine.SceneManagement.LoadSceneParameters();
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #7
0
        public static void LoadScene(int sceneBuildIndex)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(LoadSceneMode.Single);

            SceneManager.LoadScene(sceneBuildIndex, parameters);
        }
コード例 #8
0
 public static Scene LoadScene(string sceneName, LoadSceneParameters parameters)
 {
     SceneManager.LoadSceneAsyncNameIndexInternal(sceneName, -1, parameters, true);
     return(SceneManager.GetSceneAt(SceneManager.sceneCount - 1));
 }
コード例 #9
0
        public static void LoadScene(int sceneBuildIndex, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(mode);

            SceneManager.LoadScene(sceneBuildIndex, parameters);
        }
コード例 #10
0
ファイル: SceneManager2.cs プロジェクト: kingBook/unity_tools
 public static Scene LoadScene(int sceneBuildIndex, LoadSceneParameters parameters)
 {
     return(SceneManager.LoadScene(sceneBuildIndex, parameters));
 }
コード例 #11
0
        public static void LoadScene(string sceneName)
        {
            var parameters = new LoadSceneParameters(LoadSceneMode.Single);

            LoadScene(sceneName, parameters);
        }
コード例 #12
0
 public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, LoadSceneParameters parameters)
 {
     return(SceneManager.LoadSceneAsyncNameIndexInternal(null, sceneBuildIndex, parameters, false));
 }
コード例 #13
0
        public static AsyncOperation LoadSceneAsync(string sceneName)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(LoadSceneMode.Single);

            return(SceneManager.LoadSceneAsync(sceneName, parameters));
        }
コード例 #14
0
        private static AsyncOperation LoadSceneAsyncNameIndexInternal(string sceneName, int sceneBuildIndex, LoadSceneParameters parameters, bool mustCompleteNextFrame)
        {
            if (!s_AllowLoadScene)
            {
                return(null);
            }

            return(SceneManagerAPI.ActiveAPI.LoadSceneAsyncByNameOrIndex(sceneName, sceneBuildIndex, parameters, mustCompleteNextFrame));
        }
コード例 #15
0
 public static extern AsyncOperation LoadSceneAsyncNameIndexInternal(string sceneName, int sceneBuildIndex, LoadSceneParameters parameters, bool mustCompleteNextFrame);
コード例 #16
0
        public static AsyncOperation LoadSceneAsync(string sceneName, [uei.DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            var parameters = new LoadSceneParameters(mode);

            return(LoadSceneAsync(sceneName, parameters));
        }
コード例 #17
0
ファイル: SceneManager2.cs プロジェクト: kingBook/unity_tools
 public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, LoadSceneParameters parameters)
 {
     return(SceneManager.LoadSceneAsync(sceneBuildIndex, parameters));
 }
コード例 #18
0
        public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, [uei.DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            var parameters = new LoadSceneParameters(mode);

            return(LoadSceneAsync(sceneBuildIndex, parameters));
        }
コード例 #19
0
        public static void LoadScene(int sceneBuildIndex)
        {
            var parameters = new LoadSceneParameters(LoadSceneMode.Single);

            LoadScene(sceneBuildIndex, parameters);
        }
コード例 #20
0
        public static void LoadScene(int sceneBuildIndex, [uei.DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            var parameters = new LoadSceneParameters(mode);

            LoadScene(sceneBuildIndex, parameters);
        }
コード例 #21
0
 public static Scene LoadScene(int sceneBuildIndex, LoadSceneParameters parameters)
 {
     SceneManager.LoadSceneAsyncNameIndexInternal(null, sceneBuildIndex, parameters, true);
     return(SceneManager.GetSceneAt(SceneManager.sceneCount - 1));
 }
コード例 #22
0
ファイル: SceneManager2.cs プロジェクト: kingBook/unity_tools
 public static AsyncOperation LoadSceneAsync(string sceneName, LoadSceneParameters parameters)
 {
     sceneName = getBuildSettingsScenePath(sceneName);
     return(SceneManager.LoadSceneAsync(sceneName, parameters));
 }
コード例 #23
0
        public static AsyncOperation LoadSceneAsync(int sceneBuildIndex)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(LoadSceneMode.Single);

            return(SceneManager.LoadSceneAsync(sceneBuildIndex, parameters));
        }
コード例 #24
0
        private static AsyncOperation LoadSceneAsyncNameIndexInternal(string sceneName, int sceneBuildIndex, LoadSceneParameters parameters, bool mustCompleteNextFrame)
        {
            bool           flag = !SceneManager.s_AllowLoadScene;
            AsyncOperation result;

            if (flag)
            {
                result = null;
            }
            else
            {
                result = SceneManagerAPI.ActiveAPI.LoadSceneAsyncByNameOrIndex(sceneName, sceneBuildIndex, parameters, mustCompleteNextFrame);
            }
            return(result);
        }
コード例 #25
0
        public static AsyncOperation LoadSceneAsync(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(mode);

            return(SceneManager.LoadSceneAsync(sceneName, parameters));
        }
コード例 #26
0
        public static void LoadScene(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(mode);

            SceneManager.LoadScene(sceneName, parameters);
        }
コード例 #27
0
 public static AsyncOperation LoadSceneAsync(string sceneName, LoadSceneParameters parameters)
 {
     return(SceneManager.LoadSceneAsyncNameIndexInternal(sceneName, -1, parameters, false));
 }
コード例 #28
0
        public static void LoadScene(string sceneName)
        {
            LoadSceneParameters parameters = new LoadSceneParameters(LoadSceneMode.Single);

            SceneManager.LoadScene(sceneName, parameters);
        }
コード例 #29
0
 protected internal virtual AsyncOperation LoadSceneAsyncByNameOrIndex(string sceneName, int sceneBuildIndex, LoadSceneParameters parameters, bool mustCompleteNextFrame) =>
 SceneManagerAPIInternal.LoadSceneAsyncNameIndexInternal(sceneName, sceneBuildIndex, parameters, mustCompleteNextFrame);
コード例 #30
0
        public static void LoadScene(string sceneName, [uei.DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            var parameters = new LoadSceneParameters(mode);

            LoadScene(sceneName, parameters);
        }