void Awake() { if (instance == null) { instance = this; } }
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); }