//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>();
    }
Пример #2
0
 void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Пример #3
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Пример #4
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }