// Use this for initialization void Start () { myRot = Quaternion.identity; //myStats = new creatureStats(); myStats = this.gameObject.GetComponent<creatureStats>(); myController = GetComponent<CharacterController>(); runAway = false; runFromTarget = Vector3.zero; targetPosition = Vector3.zero; fireOn = false; imOnFire.enableEmission = false; waitForNexFire = false; burning = false; moveToTarget = false; foreach (Transform child in transform) { myChild = child; } storeMat = myChild.renderer.material; }
// Use this for initialization void Start () { player = trackPlayer.GetComponent<creatureStats>(); }
void OnTriggerEnter(Collider other) { var otherCreature = other.GetComponent<creatureStats>(); if (otherCreature) { if (otherCreature.imDead == true && mouthIsFull == false) { thingInMyMouth = otherCreature.gameObject; mouthIsFull = true; thingInMyMouth.gameObject.GetComponent<CharacterController>().detectCollisions = false; preyStats = thingInMyMouth.gameObject.GetComponent<creatureStats>(); preyStats.inMouth = true; } } }