// Singleton private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
private GameObject Target; //What we currently are engaging private void Start() { if (gameObject.GetComponent <DetectEnemies>() != null) { myDetectEnemies = gameObject.GetComponent <DetectEnemies>(); } else { Debug.LogError(gameObject.name + " IS NOT CONIFGURED PROPERLY. Needs a DetectEnemies script."); } if (gameObject.GetComponent <CharacterController>() != null) { myChar = gameObject.GetComponent <CharacterController>(); } else { Debug.LogError(gameObject.name + " IS NOT CONFIGURED PROPERLY. If you don't have a character controller on here what the f**k are you doing?"); } //Invoke("OnEnable", 0); }