/// <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; } }
/// <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; } }
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"); }
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"); }
/// <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); } }
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 }
/// <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; } }