private void Awake() { spriteRenderer = GetComponentInChildren <SpriteRenderer>(); spinner = GetComponentInChildren <SpinnyThing>(); pathFollower = GetComponent <PathFollower>(); killSound = GameObject.Find("KillSound").GetComponent <AudioSource>(); }
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; } }