Esempio n. 1
0
    // ------------------------------------------------------------------------------------------------

    // This function starts the game from an overlay screen button click, either at the very beginning
    // or end of the game, or between levels or lives, or on manual reset:
    public void GameStart()
    {
        sfxsrcGameManager.PlayOneShot(sfxclpButton);
        if (goScreenTitle.activeSelf)
        {
            goScreenTitle.SetActive(false);
            cubeController.StartFirstLevel();
        }
        else if (goScreenLevelCleared.activeSelf)
        {
            goScreenLevelCleared.SetActive(false);
            cubeController.StartNextLevel();
            // Destroy characters and items
            // Remove objects
            // Rotate cube
            // Insert objects
            // Instantiate characters and items
        }
        else if (goScreenLevelFailed.activeSelf)
        {
            goScreenLevelFailed.SetActive(false);
            cubeController.RestartThisLevel();
            // goSpawnManager.GetComponent<SpawnManager>().Destroy();
            // goSpawnManager.GetComponent<SpawnManager>().Instantiate();
        }
        else if (goScreenHUD.activeSelf)
        {
            if (bNumProjectileFlash)
            {
                EndNumProjectileFlash();
            }
            cubeController.RestartThisLevel();
        }
        else if (goScreenRestart.activeSelf)
        {
            sfxsrcGameManager.Stop();
            goScreenRestart.SetActive(false);
            cubeController.StartNextLevel();
        }
        bInPlay             = true;
        bActiveScreenButton = false;
        goScreenHUD.SetActive(true);
        bProjectilePathDependentLevel = cubeController.GetbProjectilePathDependentLevel();
    }