예제 #1
0
        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.SetModeStatus(Random.Range(1, 4)); //Set a random Out of the Egg animation
            }

            OnEggCrack.Invoke();

            StartCoroutine(EggDisapear(removeShells));
        }