示例#1
0
 void Start()
 {
     rend        = GetComponent <SpriteRenderer>();
     audioSource = GetComponent <AudioSource>();
     mainCamera  = Camera.main.transform;
     player      = mainCamera.GetComponent <DoomGame_Player>();
     player.enemies.Add(this);
 }
示例#2
0
 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);
     }
 }