Esempio n. 1
0
 private void Awake()
 {
     if (gameManagerControl == null)
     {
         gameManagerControl = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 2
0
    void Awake()
    {
        // Force unity singleton pattern for gamemanager
        if (instance == null)
        {
            instance = this;
        }
        // If instance already exists and it's not equal to this, then destroy this (gameObject is this). Forces singleton pattern
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        // Init the canvas controller
        CanvasControllerScript = FindObjectOfType <CanvasController>();
        backgroundMusic        = GetComponent <AudioSource>();
    }
Esempio n. 3
0
 internal void IAm(GameManagerControl gameManagerControl)
 {
     theManager = gameManagerControl;
 }
Esempio n. 4
0
 void Start()
 {
     growingTimer         = 0;
     transform.localScale = startingScale * Vector3.one;
     theManager           = FindObjectOfType <GameManagerControl>();
 }
Esempio n. 5
0
 public void SetGameManager(GameManagerControl tmp)
 {
     gmManager = tmp;
 }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     myGameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerControl>();
     SetNewTarget();
 }
Esempio n. 7
0
 // Use this for initialization
 public virtual void Start()
 {
     myGameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerControl>();
 }