public static Witchcraft ExecuteAsync(System.Func <Magic> func, CallbackType callbackType) { var witchcraft = new Witchcraft(); witchcraft.exec = func; witchcraft.async = true; witchcraft.callbackType = callbackType; WitchcraftBehaviour.GetInstance().witchcrafts.Add(witchcraft); return(witchcraft); }
static void Loaded(AsyncOperation async) { loading = false; var page = GetCurrentPage(); page.AfterInitialize(); if (page.IsTransitionWait) { Witchcraft.ExecuteCoroutine(TransitionWait(page)); } else { var lastScene = SceneManager.GetSceneAt(SceneManager.sceneCount - 2); SceneManager.UnloadSceneAsync(lastScene); } }