Exemple #1
0
    void Awake()
    {
        cameraController   = FindObjectOfType <ThirdPersonCameraController>();
        movementController = FindObjectOfType <GabrielsMovementController>();
        animatorController = FindObjectOfType <GabiesAnimationController>();
        AudioManager.Instance.PlaySong(3, 0.2f);

        if (PlayerPrefs.GetInt("SaveHealth", 0) == 1)
        {
            Health  = 100f;
            Stamina = 100f;
            PlayerPrefs.SetInt("SaveHealth", 0);
        }


        if (Time.timeScale == 0)
        {
            Time.timeScale = 1f;
        }

        if (gabie != null && gabie != this)
        {
            Destroy(gameObject);
        }
        else
        {
            gabie = this;
        }
    }
Exemple #2
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }