Exemplo n.º 1
0
 /// <summary>
 ///  //Enable Optional Animator Parameters on the Animator Controller;
 /// </summary>
 protected void OptionalAnimatorParameters()
 {
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, "Swim"))
     {
         hasSwim = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, "Dodge"))
     {
         hasDodge = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, "Fly"))
     {
         hasFly = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, "Attack2"))
     {
         hasAttack2 = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, "Underwater"))
     {
         hasUnderwater = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, "UpDown"))
     {
         hasUpDown = true;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///  //Enable Optional Animator Parameters on the Animator Controller;
 /// </summary>
 protected void OptionalAnimatorParameters()
 {
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Swim))
     {
         hasSwim = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Dodge))
     {
         hasDodge = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Fly))
     {
         hasFly = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Attack2))
     {
         hasAttack2 = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Stunned))
     {
         hasStun = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, Hash.Underwater))
     {
         hasUnderwater = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, Hash.UpDown))
     {
         hasUpDown = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, Hash.Slope))
     {
         hasSlope = true;
     }
 }
Exemplo n.º 3
0
 void Awake()
 {
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, Hash.Type))
     {
         Anim.SetInteger(Hash.Type, animalTypeID);  //Adjust the layer for the curret animal Type this is of offseting the bones to another pose
     }
     WaterLayer = LayerMask.GetMask("Water");
 }
Exemplo n.º 4
0
        void Awake()
        {
            AnimalMesh = GetComponentInChildren <Renderer>();
            anim       = GetComponent <Animator>();
            _transform = transform;

            if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, Hash.Type))
            {
                Anim.SetInteger(Hash.Type, animalTypeID);                         //Adjust the layer for the curret animal Type this is of offseting the bones to another pose
            }
            WaterLayer = LayerMask.GetMask("Water");
        }
Exemplo n.º 5
0
        /// <summary>Enable Optional Animator Parameters on the Animator Controller;</summary>
        protected virtual void OptionalAnimatorParameters()
        {
            hasUpDown          = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_UpDown);
            hasDeltaAngle      = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_DeltaAngle);
            hasSlope           = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_Slope);
            hasSpeedMultiplier = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_SpeedMultiplier);
            hasStateTime       = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_StateTime);
            hasStance          = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, hash_Stance);
            hasRandom          = MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, hash_Random);

            if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, hash_Type)) //This is only done once!
            {
                Anim.SetInteger(hash_Type, animalType);
            }
        }
Exemplo n.º 6
0
        void Awake()
        {
            AnimalMesh = GetComponentInChildren <Renderer>();
            anim       = GetComponent <Animator>();
            _transform = transform;

            if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, Hash.Type))
            {
                Anim.SetInteger(Hash.Type, animalTypeID);                         //Adjust the layer for the curret animal Type this is of offseting the bones to another pose
            }
            WaterLayer = LayerMask.GetMask("Water");

            anim.applyRootMotion = true; //To make it work with another assets...

            //if (animalProxy) animalProxy.SetAnimal(this);                       //Set this animal as proxy
        }
Exemplo n.º 7
0
 /// <summary>
 ///  //Enable Optional Animator Parameters on the Animator Controller;
 /// </summary>
 protected void OptionalAnimatorParameters()
 {
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Swim))
     {
         hasSwim = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Dodge))
     {
         hasDodge = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Fly))
     {
         hasFly = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Attack2))
     {
         hasAttack2 = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Stunned))
     {
         hasStun = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Bool, hash_Underwater))
     {
         hasUnderwater = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_UpDown))
     {
         hasUpDown = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_Slope))
     {
         hasSlope = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Float, hash_StateTime))
     {
         hasStateTime = true;
     }
     if (MalbersTools.FindAnimatorParameter(Anim, AnimatorControllerParameterType.Int, hash_Stance))
     {
         hasStance = true;
     }
 }