Exemple #1
0
    protected override void OnInteractButtonPress()
    {
        if (runner == null)
        {
            runner = dialouge.GetComponent <DialogueRunner>();
        }

        if (runner == null || runner.isDialogueRunning || PauseManager.Instance.Paused)
        {
            return;
        }

        base.OnInteractButtonPress();
        GlobalStorage.Instance.storage.SetValue("checkpoint_id", Id);
        GlobalStorage.Instance.storage.SetValue("checkpoint_scene", m_currentSceneName);

        var hp = Player.Instance.gameObject.GetComponent <PlayerHealth>();

        hp.currentHealth.Value = hp.maxHealth.Value;

        if (activated == false)
        {
            CheckPointManager.Instance.checkPoints.Add(Id);
            Tween.Color(waypointLight, waypointLight.color, lightColor, .2f, 0.2f, Tween.EaseInOut, Tween.LoopType.None, null, null, true);
            particles.SetActive(true);
            dialouge.SetActive(true);
            activated = true;
        }
        else
        {
            StartCoroutine(TeleportToPrompt());
        }

        PersistentDataManager.SaveExternal();
    }
Exemple #2
0
    void OnFadeOut()
    {
        TransitionManager.Instance.onTransitionEnd -= OnFadeOut;
        GlobalStorage.Instance.storage.SetValue("checkpoint_id", startId);
        GlobalStorage.Instance.storage.SetValue("checkpoint_scene", sceneName);
        PersistentDataManager.SaveExternal("SaveData");

        SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
    }
Exemple #3
0
    private void NewGame()
    {
        TransitionManager.Instance.onTransitionEnd -= NewGame;

        //copy default values.
        GlobalStorage.Instance.storage.CopyValues(DefaultGlobalStorageValues);

        PersistentDataManager.SaveExternal();
        HUD.SetActive(true);
        StartCoroutine(delayedSceneLoad());
    }
Exemple #4
0
    protected IEnumerator PlayerDead()
    {
        yield return(new WaitForSeconds(deathWaitTime));

        var ic = GetComponent <InputController>();

        ic.joystick = Vector2.zero;
        ic.dodge.SetValue(false);
        ic.input.SetValue(false);
        playerDeath.Invoke();

        var hp = Player.Instance.gameObject.GetComponent <PlayerHealth>();

        hp.currentHealth = hp.maxHealth;

        PersistentDataManager.SaveExternal();
        SceneManager.LoadScene("TitleTitle");
    }
Exemple #5
0
    public void OnFadeOut()
    {
        TransitionManager.Instance.onTransitionEnd -= OnFadeOut;

        if (ExternalScene)
        {
            GlobalStorage.Instance.storage.SetValue(isCheckPoint ? "checkpoint_id" : "doorTag", Id);

            if (isCheckPoint)
            {
                GlobalStorage.Instance.storage.SetValue("checkpoint_scene", sceneName);
                CheckPointManager.Instance.checkPoints.Add(Id);
            }

            PersistentDataManager.SaveExternal();

            SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
        }
        else
        {
            TeleportToTag(_teleportObj, this, Id);
        }
    }