Example #1
0
 private void Start()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this);
     }
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     rb2D     = GetComponent <Rigidbody2D>();
     dino     = GetComponent <DinoController>();
     settings = FindObjectOfType <DinoSettings>();
 }