void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (!(scene.name == "Lvl3InitScene" || scene.name == "Limpieza" || scene.name == "Limpieza" || scene.name == "LvL4Colores" || scene.name == "Puzzle" || scene.name == "Reconstruction"))
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (scene.buildIndex == 0)
     {
         GameObject t = Instantiate(MainMenu);
     }
 }
Ejemplo n.º 3
0
 private void OnSceneLoadedCallback(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (OnSceneLoaded != null)
     {
         OnSceneLoaded(scene.name, (DrbFramework.Scene.LoadSceneMode)mode);
     }
 }
Ejemplo n.º 4
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadingMode)
 {
     Debug.Log("Loading Screen!");
     if (!Physics.Raycast(transform.position, -Vector3.up, 5f))
     {
         transform.position = new Vector3(0f, 5f, 0f);
     }
 }
Ejemplo n.º 5
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (!SaveGame.Exists("saved") && SceneManager.GetActiveScene().buildIndex - 1 == 0)
     {
         startpoint         = GameObject.FindGameObjectWithTag("StartPoint");
         transform.position = startpoint.transform.position;
     }
 }
Ejemplo n.º 6
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (scene.name == "MainMenu")
     {
         Destroy(gameObject);
         Debug.Log("I am inside the if statement");
     }
 }
Ejemplo n.º 7
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (!SaveGame.Exists("currenthp"))
     {
         playerCurrentHealth = 50;
         playerMaxHealth     = 50;
     }
 }
Ejemplo n.º 8
0
 private void HandleSceneLoaded(SM.Scene scene,
                                SM.LoadSceneMode loadMode)
 {
     if (scene == SM.SceneManager.GetSceneByName(SceneName))
     {
         SM.SceneManager.sceneLoaded -= HandleSceneLoaded;
         // Notify scene loaded
         Global.Instance.GameManager.RaiseGameStateChangedEvent(State);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Prepara la escena de la partida una vez se han escogido todas las configuraciones de la partida
 /// y se han posicionado los barcos del jugador
 /// </summary>
 /// <param name="arg0"></param>
 /// <param name="arg1"></param>
 private void SetPartida(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     InstanciarMisBarcos();
     InstanciarBarcosIA();
     UnityEngine.SceneManagement.SceneManager.sceneLoaded -= SetPartida;
     turnoDelUsuario = Random.Range(0, 2) == 0 ? true : false;
     emepezoPartida  = true;
     dineroGanado    = 0;
     status          = "";
 }
Ejemplo n.º 10
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (excludedScenes.Contains(scene.name))
     {
         if (gameObject != null)
         {
             Destroy(this.gameObject, 1);
         }
     }
 }
Ejemplo n.º 11
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     /*if (scene.name == "Menu") {
      *      gameObject.SetActive (false);
      *
      * }else {
      *      transform.gameObject.SetActive (true);
      *
      * }*/
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 异步加载场景
        /// </summary>
        /// <param name="sceneName"></param>
        public AsyncOperation LoadSceneAsync(string sceneName, LoadSceneMode mode = LoadSceneMode.Additive)
        {
            if (_resourceHelper == null)
            {
                return(null);
            }
            AsyncOperation asyncOperation = _resourceHelper.LoadSceneAsync(sceneName, mode);

            _sceneAsyncOperations.Add(sceneName, asyncOperation);
            return(asyncOperation);
        }
Ejemplo n.º 13
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (!SaveGame.Exists("lvl"))
     {
         currentHP      = HPLevels [1];
         currentAttack  = attackLevels [1];
         currentDefense = defenseLevels [1];
         currentLevel   = 1;
         currentExp     = 0;
     }
 }
Ejemplo n.º 14
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (scene.name == "Menu")
     {
         Destroy(player);
     }
     else
     {
         Instantiate(playerprefab, transform.position, transform.rotation);
     }
 }
Ejemplo n.º 15
0
 public static int LoadScene3_wrap(long L)
 {
     try
     {
         int arg0 = FCLibHelper.fc_get_int(L, 0);
         UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)(FCLibHelper.fc_get_int(L, 1));
         UnityEngine.SceneManagement.SceneManager.LoadScene(arg0, arg1);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Ejemplo n.º 16
0
    void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
    {
        if (instance == this)
        {
            if (scene.buildIndex == 0)
            {
                canPlaySounds = false;
                count         = 0;

                p1Score = 0;
                p2Score = 0;
            }
            else if (scene.buildIndex == 1)
            {
                secondsLeft   = secLeft_Copy;
                countingDown  = false;
                canPlaySounds = true;
                gameOngoing   = true;
                GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
                p1 = players[0].GetComponent <PlayerController>();
                p2 = players[1].GetComponent <PlayerController>();

                GameObject[] playerheads = GameObject.FindGameObjectsWithTag("playerHead"); // This has the orders backwards for some reason...
                p1Mouth    = playerheads[1].GetComponent <playerMouth>();
                p2Mouth    = playerheads[0].GetComponent <playerMouth>();
                p1Mouth.gm = instance;
                p2Mouth.gm = instance;

                balls     = GameObject.FindGameObjectsWithTag("Ball");
                ballCount = balls.Length;   //This is how we know how many balls are in the scene when the game starts
                count     = 0;

                p1Score = 0;
                p2Score = 0;

                GameObject[] timerTexts = GameObject.FindGameObjectsWithTag("test");
                timeTextBlue      = timerTexts[0].GetComponent <Text>();
                timeTextRed       = timerTexts[1].GetComponent <Text>();
                timeTextBlue.text = secondsLeft.ToString();
                timeTextRed.text  = secondsLeft.ToString();
            }
            else if (scene.buildIndex == 2)
            {
                canPlaySounds = false;
                StopAllCoroutines();
                background = GameObject.FindGameObjectWithTag("Background");
                isThisWinScreen();
            }
        }
    }
Ejemplo n.º 17
0
        public void LoadScene(string scenepath, UnityEngine.SceneManagement.LoadSceneMode mode)
        {
            Application.backgroundLoadingPriority = loadingPriority;
#if UNITY_EDITOR
            AsyncOperation op = EditorSceneManager.LoadSceneAsync(scenepath, mode);
#else
            AsyncOperation op = SceneManager.LoadSceneAsync(scenepath, mode);
#endif
            if (op != null)
            {
                op.allowSceneActivation = false;
                mCurrentLoadOps.Add(op);
                currentState = LoadingState.Loading;
            }
        }
Ejemplo n.º 18
0
        public override bool LoadBundleScene(string bundleName, string sceneName, UnityEngine.SceneManagement.LoadSceneMode mode)
        {
            if (!simulateAssetBundle)
            {
                return(base.LoadBundleScene(bundleName, sceneName, mode));
            }

            if (mode == LoadSceneMode.Additive)
            {
                UnityEditor.EditorApplication.LoadLevelAdditiveInPlayMode(bundleName);
            }
            else
            {
                UnityEditor.EditorApplication.LoadLevelInPlayMode(bundleName);
            }
            return(true);
        }
Ejemplo n.º 19
0
 public static int LoadSceneAsync3_wrap(long L)
 {
     try
     {
         int arg0 = FCLibHelper.fc_get_int(L, 0);
         UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)(FCLibHelper.fc_get_int(L, 1));
         UnityEngine.AsyncOperation ret = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0, arg1);
         long ret_ptr = FCLibHelper.fc_get_return_ptr(L);
         long v       = FCGetObj.PushObj(ret);
         FCLibHelper.fc_set_value_wrap_objptr(ret_ptr, v);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Ejemplo n.º 20
0
    void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
    {
        if (SceneManager.GetActiveScene().buildIndex == 0)
        {
            /*if (mobile == null) {
             *      mobile = GameObject.FindGameObjectWithTag ("MobileController");
             * }
             * mobile.SetActive (false);*/

            //Destroy (gameObject);
            GameObject[] allObjects = GameObject.FindGameObjectsWithTag("SceneChanger");
            foreach (GameObject obj in allObjects)
            {
                Destroy(obj);
            }
        }
    }
Ejemplo n.º 21
0
    static private void ProcOnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
    {
        if (CManagerUILocalize.instance != null)
        {
            CManagerUILocalize.instance.DoSetLocalize_CurrentScene();
        }

        p_pManagerScene.EventCheckIsLoadComplete();

        instance.OnSceneLoaded(arg0, arg1);
        if (_OnFinishLoad_Scene != null && _strCallBackRequest_SceneName != null && _strCallBackRequest_SceneName.CompareTo(arg0.name) == 0)
        {
            _strCallBackRequest_SceneName = "";
            System.Action OnFinishCurrentScene = _OnFinishLoad_Scene;
            _OnFinishLoad_Scene = null;
            OnFinishCurrentScene();
        }
    }
Ejemplo n.º 22
0
        static void OnLevelFinishedLoading(sm.Scene scene, sm.LoadSceneMode mode)
        {
            // Stuff to do when scene has finished loading

            if (current.scenes[scene.buildIndex].gameScene)
            {
                CoreManager.current.inGame = true;
                CoreManager.current.player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
            }
            else
            {
                CoreManager.current.inGame = false;
            }

            CoreManager.UpdatePresence();

            sm.SceneManager.sceneLoaded -= OnLevelFinishedLoading;
        }
Ejemplo n.º 23
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     //if (scene.name == "StoryScene")
     //{
     //    bgm.volume -= Time.deltaTime;
     //    Destroy(gameObject);
     //    //Debug.Log("I am inside the if statement");
     //}
     if (bgm != null)
     {
         if (scene.name == "StoryScene")
         {
             bgm.volume -= Time.deltaTime;
             Destroy(gameObject);
             //Debug.Log("I am inside the if statement");
         }
     }
 }
Ejemplo n.º 24
0
 void onSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (instance == this)
     {
         string name = scene.name;
         if (name == "HubRoom")
         {
             HubCount = HubCount + 1;
         }
         else if (name == "Title Screen")
         {
             //do f*****g nothing
         }
         else
         {
             SHMUPCount = SHMUPCount + 1;
         }
     }
 }
Ejemplo n.º 25
0
 // The onSceneLoaded function is where you are going to do most of the data pushing from scene to scene.
 void onSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     if (instance == this)
     {
         currentSceneName = scene.name;
         if (scene.name == mainMenuSceneName)
         {
             if (playerJoinManager == null)
             {
                 playerJoinManager = GameObject.FindGameObjectWithTag("player-join-manager").GetComponent <PlayerJoinManager>();
             }
         }
         else if (scene.name != mainMenuSceneName)           // WE ARE ASSUMING ANYTHING THAT ISN'T THE MAIN MENU IS A LEVEL. THIS IS CLEARLY NOT GOING TO BE THE CASE AT ALL TIMES, SO UPDATE THIS AS NEEDED.
         {
             if (players == null)
             {
                 Debug.LogWarning("GameManager did not recieve players from main menu, defaulting to 4 players on, This is correct if starting editor from game scene");
                 SetUpPlayers(new bool[] { true, true, true, true }, new int[] { 0, 1, 2, 3 }); // Set up players if game is not started in main menu
                 StartCoroutine(UpdateGame());
             }
         }
         if (countdownText == null)
         {
             countdownText = GameObject.FindGameObjectWithTag("countdown");
         }
         if (audioManager == null)
         {
             audioManager = Instantiate(audioManagerPrefab).GetComponent <AudioManager>();
             audioManager.gameObject.name = "AudioManager"; //I don't like it being named "Clone"
             DontDestroyOnLoad(audioManager);
             if (scene.name == mainMenuSceneName)
             {
                 GameManager.instance.audioManager.Play("Main Menu");
             }
         }
         if (curveManager == null && scene.name != mainMenuSceneName && scene.name != winnerSceneName)
         {
             curveManager = GameObject.FindGameObjectWithTag("ghost-curve").GetComponent <CurveManager>();
             //This will be destroyed on load because a different scene might have a different curve manager
         }
     }
 }
Ejemplo n.º 26
0
    public IEnumerator LoadSceneAsync(
        string path, string name,
        Action <AsyncOperation> onStarted,
        Action <float> onLoading,
        Action <AsyncOperation> onFinished,
        UnityEngine.SceneManagement.LoadSceneMode mode = UnityEngine.SceneManagement.LoadSceneMode.Single)
    {
        Debug.Log("Async load scene " + name);
        AsyncOperation ao;

#if UNITY_EDITOR
        if (editorUseAssetBundle)
        {
#endif
        AssetBundle bundle = LoadAssetBundle(string.Format("{0}.ab", path.ToLower()));
#if UNITY_EDITOR
    }
#endif
        ao = SceneManager.LoadSceneAsync(name, mode);
        if (onStarted != null)
        {
            onStarted(ao);
        }

        while (!ao.isDone && ao.progress < 0.85)
        {
            if (onLoading != null)
            {
                onLoading(ao.progress);
            }

            yield return(null);
        }

        if (onFinished != null)
        {
            onFinished(ao);
        }

        Debug.Log("Load scene " + name + " end");
    }
Ejemplo n.º 27
0
        private void OnSceneLoaded(ExampleOfBadOrganization arg0, LoadExampleOfBadOrganizationMode arg1)
        {
            new Thot().AddComponent <WhyUnityYouPieceOfCrap>();
            if (arg0.name != "MenuCore")
            {
                return;
            }
            SubMenu            pokeables  = SettingsUI.CreateSubMenu("Fun Times");
            BoolViewController acidShader = pokeables.AddBool("Acid Shader [SEIZURE WARNING]");

            acidShader.GetValue += delegate { return(acidShaderMode); };
            acidShader.SetValue += delegate(bool value) { acidShaderMode = value; ShittySaveSystem.SetInt("acidShaderMode", value ? 1 : 0); };
            BoolViewController spinnyBoi = pokeables.AddBool("Spinny Boi Mode");

            spinnyBoi.GetValue += delegate { return(spinnyBoiMode); };
            spinnyBoi.SetValue += delegate(bool value) { spinnyBoiMode = value; ShittySaveSystem.SetInt("spinnyBoiMode", value ? 1 : 0); };
            BoolViewController savePokeyBois = pokeables.AddBool("Spare Pokey Bois");

            savePokeyBois.GetValue += delegate { return(savePokeyBoisMode); };
            savePokeyBois.SetValue += delegate(bool value) { savePokeyBoisMode = value; ShittySaveSystem.SetInt("savePokeyBoisMode", value ? 1 : 0); };
            //BoolViewController endlessDespair = pokeables.AddBool("Void of Despair");
            //endlessDespair.GetValue += delegate { return endlessDespairMode; };
            //endlessDespair.SetValue += delegate (bool value) { endlessDespairMode = value; ShittySaveSystem.SetInt("endlessDespairMode", value ? 1 : 0); };
        }
 /// <summary> 在加载场景时使用,收到通知 </summary>
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     Debug.Log("OnSceneLoaded: " + scene.name);
     Debug.Log(mode);
 }
Ejemplo n.º 29
0
    void EditorSceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
    {
        if (arg0.name == "MainMenu" || player != null)
        {
            return;
        }

        //make player
        player = (GameObject)Instantiate(Resources.Load <GameObject>("Prefabs/Entities/Player"), (Vector3)(spawnCoordinates), Quaternion.identity);
        Entity entScr = player.transform.GetComponent <Entity>();
        Player plyScr = player.transform.GetComponent <Player>();

        //set up stats and default abilites depending on class
        switch (playerClass)
        {
        case PlayerClass.defender:
            plyScr.bullet      = Resources.Load <GameObject>("Prefabs/Bullets/" + playerBullet);
            plyScr.myClass     = playerClass;
            entScr.healthMax   = 150f;
            entScr.health      = entScr.healthMax;
            entScr.healthRegen = 1.25f;
            entScr.heatMax     = 100f;
            entScr.heat        = 0;
            entScr.heatDecay   = 0.25f;
            entScr.speed       = 25;
            entScr.addAbility(new FlakShot(player.transform, plyScr.bullet), 0);
            entScr.addAbility(new AbsorptionField(player.transform), 1);

            player.transform.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/Game/Entities/PlayerDefender");
            break;

        case PlayerClass.skirmisher:
            plyScr.bullet      = Resources.Load <GameObject>("Prefabs/Bullets/" + playerBullet);
            plyScr.myClass     = playerClass;
            entScr.healthMax   = 75f;
            entScr.health      = entScr.healthMax;
            entScr.healthRegen = 0.5f;
            entScr.heatMax     = 100f;
            entScr.heat        = 0;
            entScr.heatDecay   = 0.25f;
            entScr.speed       = 45;
            entScr.addAbility(new BurstShot(player.transform, plyScr.bullet), 0);
            entScr.addAbility(new Dash(player.transform), 1);

            player.transform.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/Game/Entities/PlayerSkirmisher");
            break;

        case PlayerClass.caster:
            plyScr.bullet      = Resources.Load <GameObject>("Prefabs/Bullets/" + playerBullet);
            plyScr.myClass     = playerClass;
            entScr.healthMax   = 50f;
            entScr.health      = entScr.healthMax;
            entScr.healthRegen = 0.5f;
            entScr.heatMax     = 200f;
            entScr.heat        = 0;
            entScr.heatDecay   = 0.5f;
            entScr.speed       = 35;
            entScr.addAbility(new RailgunShot(player.transform, plyScr.bullet), 0);
            entScr.addAbility(new CoreOverload(player.transform), 1);

            player.transform.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprites/Game/Entities/PlayerCaster");
            break;
        }

        //add flexAbilities
        for (int i = 0; i < 3; i++)
        {
            if (flexAbilities [i] == null)
            {
                continue;
            }
            flexAbilities [i].invoker = player.transform;
            if (flexAbilities [i] is BulletFlexAbility)
            {
                ((BulletFlexAbility)flexAbilities [i]).bulletPrefab = plyScr.bullet;
            }
            entScr.addAbility(flexAbilities[i].Copy(), i + 2);
        }

        //add learned abilities TODO some bug with this causes duplication
        plyScr.learnedAbilities = (ArrayList)learnedAbilites.Clone();
        for (int i = 0; i < plyScr.learnedAbilities.Count; i++)
        {
            ((Ability)learnedAbilites [i]).invoker = player.transform;
        }
    }
Ejemplo n.º 30
0
 void CheckSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     Debug.Log(scene.name + " : " + mode.ToString());
 }