Exemplo n.º 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
 private void Start()
 {
     forward = GameObject.Find("Forward").GetComponent <NewBehaviourScript>();
     back    = GameObject.Find("Backward").GetComponent <Backward>();
     bbrake  = GameObject.Find("Brake").GetComponent <brake>();
     NewBehaviourScript.instance.SetPlayer(this.gameObject);
     brake.instance.SetPlayer(this.gameObject);
     Backward.instance.SetPlayer(this.gameObject);
 }