plantilla base para movimiento básico
This commit is contained in:
Robii Aragon
2026-02-05 05:07:55 -08:00
parent 195b696771
commit 779f2c8b20
14443 changed files with 23840465 additions and 452 deletions

View File

@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class simpleIKHand : OnAnimatorIKComponent
{
[Header ("Main Settings")]
[Space]
public bool simpleIKHandActive;
public float IKWeight;
public AvatarIKGoal handIKGoal;
[Space]
[Header ("Components")]
[Space]
public Animator mainAnimator;
public Transform IKPositionTransform;
public override void updateOnAnimatorIKState ()
{
if (simpleIKHandActive) {
mainAnimator.SetIKRotationWeight (handIKGoal, IKWeight);
mainAnimator.SetIKPositionWeight (handIKGoal, IKWeight);
mainAnimator.SetIKPosition (handIKGoal, IKPositionTransform.position);
mainAnimator.SetIKRotation (handIKGoal, IKPositionTransform.rotation);
}
}
public override void setActiveState (bool state)
{
simpleIKHandActive = state;
}
public override void setCharacterElements (GameObject newCharacter)
{
playerComponentsManager currentPlayerComponentsManager = newCharacter.GetComponent<playerComponentsManager> ();
if (currentPlayerComponentsManager != null) {
mainAnimator = currentPlayerComponentsManager.getPlayerController ().getCharacterAnimator ();
}
}
}