Esempio n. 1
0
        public static void LoadScene(string _package, string _file
                                     , OnLoadReadyDelegate _onReady
                                     , OnLoadSceneSuccessDelegate _onSuccess
                                     , OnErrorDelegate _onError)
        {
            if (string.IsNullOrEmpty(_package))
            {
                _onError("package is null");
                return;
            }

            if (string.IsNullOrEmpty(_file))
            {
                _onError("file is null");
                return;
            }

            if (SceneManager.GetActiveScene().name.Equals(_file))
            {
                return;
            }

            _onReady();
            resLoader.AppendExternalBundle(_package);
            ResBundle.AsyncLoadBundle(_package, (_bundle) =>
            {
                _onSuccess(_file);
            });
        }