void Awake()
 {
     levelManager = GameObject.FindObjectOfType <LevelManager> ();
     playerMove   = GameObject.FindObjectOfType <PlayerMove> ();
     playerCol    = GameObject.FindObjectOfType <PlayerCol> ();
     LoadHighScore();
 }
Example #2
0
 void Awake()
 {
     if (levelManager == null)
     {
         DontDestroyOnLoad(gameObject);
         Debug.Log("Dont destroy");
         levelManager = this;
     }
     else if (levelManager != this)
     {
         Destroy(this.gameObject);
         Debug.Log("Destroy");
     }
     scoreManager  = GameObject.FindObjectOfType <Score> ();
     scoreFeedback = GameObject.FindObjectOfType <ScoreFeedBack> ();
     playerCol     = GameObject.FindObjectOfType <PlayerCol> ();
 }
 void Awake()
 {
     rigidBody = GetComponent <Rigidbody> ();
     col       = transform.GetComponent <PlayerCol> ();
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     theScoreManager  = FindObjectOfType <ScoreManager>();
     theObjectSpawner = FindObjectOfType <ObjectSpawner>();
     playerCol        = FindObjectOfType <PlayerCol>();
 }