Beispiel #1
0
    private void LevelComplete()
    {
        levelState = LevelState.GameNotActive;
        TouchController.instance.Deactivate();
        UIController.instance.ShowLevelCompletedPanel();

        currentLevel++;

        if (currentLevel > LevelController.instance.LevelsAmount)
        {
            currentLevel = 1;
        }

        GameSettingsPrefs.Set("current level", currentLevel);

        Tween.DelayedCall(2f, StartGame);
    }
Beispiel #2
0
    public static void OnObstacleAbsorbed()
    {
        if (instance.levelState == LevelState.First || instance.levelState == LevelState.Second)
        {
            instance.levelState = LevelState.GameNotActive;
            TouchController.instance.Deactivate();
            CameraController.instance.ShakeCamera();

            if (!instance.reviveUsed)
            {
                Tween.DelayedCall(1f, instance.GameOver);
            }
            else
            {
                Tween.DelayedCall(1f, instance.StartGame);
            }
        }
    }
Beispiel #3
0
 private void OnEnable()
 {
     Tween.DelayedCall(delay, () => gameObject.SetActive(false));
 }