public void CrackEgg() { var col = GetComponent <Collider>(); anim.SetInteger("State", 1); //Crak the Egg Animation if (col) { Destroy(col); } if (animal) { animal.State_Force(StateEnum.Idle); var skinnedMeshes = animal.GetComponentsInChildren <Renderer>(); foreach (var item in skinnedMeshes) { item.enabled = true; } animal.SetIntID(Random.Range(1, 4)); //Set a random Out of the Egg animation } OnEggCrack.Invoke(); StartCoroutine(EggDisapear(removeShells)); }
/// <summary>When a Tag Changes apply this modifications</summary> public bool AnimationTagEnter(int animatorTagHash) { IsPending = true; if (MainTagHash == animatorTagHash) { General.Modify(animal); animal.SetIntID(0); IsPending = false; } TagModifier ActiveTag = TagModifiers.Find(tag => tag.TagHash == animatorTagHash); if (ActiveTag != null) { ActiveTag.modifier.Modify(animal); IsPending = false; } if (ActiveState) { AnimationStateEnter(); } return(IsPending); }
public void CrackEgg() { anim.SetInteger("State", 1); if (animal) { animal.GetComponentInChildren <SkinnedMeshRenderer>().enabled = true; animal.SetIntID(Random.Range(1, 4)); //Set a random Out of the Egg animation } OnEggCrack.Invoke(); StartCoroutine(EggDisapear(removeShells)); Invoke("EnableAnimalScript", 0.1f); }