//private bool _animating = false;

    private void OnEnable()
    {
        _collisionState = GetComponent <PlayerCollisionState>();
        _controller     = GetComponent <ControllableObject>();

        // START THE GAME MANAGER, WINDOW MANAGER, AND THE EVENT SYSTEM
        // They are not used in this script, but they started for the reset of the game.
        GameManager          GM  = GameManager.Instance.GetComponent <GameManager>();
        WindowManager        WM  = WindowManager.Instance.GetComponent <WindowManager>();
        EventSystemSingleton ESS = EventSystemSingleton.Instance.GetComponent <EventSystemSingleton>();
    }
Beispiel #2
0
 void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Beispiel #3
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Beispiel #4
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }