Пример #1
0
    public void OnClickExitPanelYesBtn()
    {
        

        //unload and load main menu
        LevelLoader.ChangeLevel();

        ExperimentRun = false;
    }
Пример #2
0
    public void OnClickGotIt()
    {
        LevelLoader.ChangeLevel();

        SfxHandler sfx = SfxHandler.SfxIns;

        if (sfx != null)
        {
            sfx.PlaySound("click_s");
            sfx.StopSound("bg_s");
        }
    }
        public void Start()
        {
            print("Starting the game");
            SetDefaults();
            if (CurrentLevel == MainMenuScene)
            {
                SceneManager.LoadScene(MainMenuScene);
                return;
            }

            LevelLoader.ChangeLevel(CurrentLevel);
        }
Пример #4
0
    IEnumerator WaitAndLoadPlz(float WAIT)
    {
        yield return(new WaitForSeconds(WAIT));

        LevelLoader.ChangeLevel();
        SfxHandler sfx = SfxHandler.SfxIns;

        if (sfx != null)
        {
            sfx.changeSpeed(0.6f, "bg_s");
            sfx.StopSound("bg_s");
        }
        DeactivateMe(this.gameObject);
    }
        public static void PlayerDeath()
        {
            print("Player has died");
            Lives--;
            if (Lives == 0)
            {
                ApplicationState.Ending = -1;
                print("Player has run out of lives, Game over");
                SceneManager.LoadScene(GameOverScene);
                return;
            }

            print(Lives + " Lives remaining");
            print("Restarting" + CurrentLevel);
            LevelLoader.ChangeLevel(CurrentLevel);
        }
Пример #6
0
        public new void OnCollisionEnter2D(Collision2D other)
        {
            Player player = other.collider.GetComponent <Player>();

            if (player != null && !player.IsDead)
            {
                if (LevelNumber > 0)
                {
                    LevelLoader.ChangeLevel("Level" + LevelNumber);
                }
                else
                {
                    LevelLoader.NextLevel();
                }
            }
        }
Пример #7
0
    public void OnClickPlayButton()
    {
        if (!playbtnclicked)
        {
            playbtnclicked = true;

            Debug.Log("hello my dear lab");

            SfxHandler sfx = SfxHandler.SfxIns;
            if (sfx != null)
            {
                sfx.PlaySound("bg_s");
            }

            //foreach (MyButtonHandler btn in MainMenuButons)
            //{
            //    DisableMyButtonHandlerInteractivity(btn);
            //}

            LevelLoader.ChangeLevel();
        }
    }
 public static void RestartGame()
 {
     SetDefaults();
     LevelLoader.ChangeLevel(LevelLoader.FirstLevel);
 }
Пример #9
0
 public void StartGame(int level)
 {
     levelLoader.ChangeLevel(level);
 }