예제 #1
0
 private void Awake()
 {
     spriteRenderer = GetComponentInChildren <SpriteRenderer>();
     spinner        = GetComponentInChildren <SpinnyThing>();
     pathFollower   = GetComponent <PathFollower>();
     killSound      = GameObject.Find("KillSound").GetComponent <AudioSource>();
 }
예제 #2
0
파일: Enemy.cs 프로젝트: pettipas/LD44
 public void ParentToSpinnyThing(SpinnyThing thing)
 {
     if (life > 0 && agent.isActiveAndEnabled)
     {
         agent.isStopped = true;
         agent.enabled   = false;
         this.enabled    = false;
         transform.SetParent(thing.transform, true);
         transform.position   += Vector3.up * height;
         thing.speed           = spinnythingspeed;
         this.gameObject.layer = Extensions.ToLayer(capturedLayer.value);
         damager.enabled       = true;
         attack.enabled        = false;
     }
 }