private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
private void Awake() { if (!instance) { instance = this; } else { Destroy(gameObject); } camera = GetComponent <Camera>(); }
// Use this for initialization void Start() { RedPlayerLight = GameObject.Find("RedCharacter").GetComponent <LightChecker>(); BluePlayerLight = GameObject.Find("BlueCharacter").GetComponent <LightChecker>(); GreenPlayerLight = GameObject.Find("GreenCharacter").GetComponent <LightChecker>(); }