Ejemplo n.º 1
0
        void Start()
        {
            anim = GetComponent <Animator>();

            if (Dragon)
            {
                if (!Dragon.activeInHierarchy)
                {
                    Dragon = Instantiate(Dragon);
                }

                animal = Dragon.GetComponent <MAnimal>();

                if (animal)
                {
                    animal.transform.position = transform.position;
                    animal.Anim.Play("Hatch");                                       //Set the egg State (This set on the animator INT -10 which is the transition for the EggHatching Start Animation
                    animal.LockInput    = true;
                    animal.LockMovement = true;
                    animal.EnableColliders(false);
                    animal.transform.localPosition += preHatchOffset;
                }

                var skinnedMeshes = Dragon.GetComponentsInChildren <Renderer>();

                foreach (var item in skinnedMeshes)
                {
                    item.enabled = false;
                }
            }


            if (hatchtype == HatchType.Time)
            {
                StartCoroutine(TimeCrackEgg());
            }
        }
Ejemplo n.º 2
0
        public void Modify(MAnimal animal)
        {
            if ((int)modify == 0)
            {
                return;                   //Means that the animal have no modification
            }
            if (Modify(modifier.IgnoreLowerStates))
            {
                animal.ActiveState.IgnoreLowerStates = IgnoreLowerStates;
            }
            if (Modify(modifier.AdditivePositionSpeed))
            {
                animal.UseAdditivePos = AdditivePosition;
            }

            //  if (Modify(modifier.AdditiveRotationSpeed)) animal.UseAdditiveRot = AdditiveRotation;
            if (Modify(modifier.RootMotion))
            {
                animal.RootMotion = RootMotion;
            }
            if (Modify(modifier.Gravity))
            {
                animal.UseGravity = Gravity;
            }
            if (Modify(modifier.Sprint))
            {
                animal.UseSprintState = Sprint;
            }

            if (Modify(modifier.Grounded))
            {
                animal.Grounded = Grounded;
            }
            if (Modify(modifier.OrientToGround))
            {
                animal.UseOrientToGround = OrientToGround;
            }
            if (Modify(modifier.CustomRotation))
            {
                animal.UseCustomAlign = CustomRotation;
            }
            if (Modify(modifier.Persistent))
            {
                animal.ActiveState.IsPersistent = Persistent;
            }
            if (Modify(modifier.LockInput))
            {
                animal.LockInput = LockInput;
            }
            if (Modify(modifier.LockMovement))
            {
                animal.LockMovement = LockMovement;
            }
            if (Modify(modifier.Colliders))
            {
                animal.EnableColliders(Colliders);
            }
            if (Modify(modifier.FreeMovement))
            {
                animal.FreeMovement = FreeMovement;
            }
        }