void Start() { rend = GetComponent <SpriteRenderer>(); audioSource = GetComponent <AudioSource>(); mainCamera = Camera.main.transform; player = mainCamera.GetComponent <DoomGame_Player>(); player.enemies.Add(this); }
void Start() { if (path == null) { path = new Vector3[0]; } rend = GetComponent <SpriteRenderer> (); audioSource = GetComponent <AudioSource> (); player = GameObject.FindObjectOfType <DoomGame_Player> (); player.enemies.Add(this); if (startDeactivated) { gameObject.SetActive(false); } }