feat: add shuriken weapon
add shuriken weapon model, 3 animations change move speed triggers animation
This commit is contained in:
@@ -12,22 +12,24 @@ namespace Reset.Units{
|
||||
public Vector3 neckRotOffset;
|
||||
|
||||
public Vector3 rotationLimit;
|
||||
|
||||
public float moveSpeed;
|
||||
|
||||
// Temporary
|
||||
private float inputMagnitude;
|
||||
|
||||
void Update(){
|
||||
// Temporary
|
||||
try {
|
||||
inputMagnitude = Mathf.MoveTowards(inputMagnitude, GetComponent<PlayerControls>().rawMoveInput.magnitude * 2f, 6f * Time.deltaTime);
|
||||
|
||||
modelAnimator.SetFloat("Move Direction X", Unit.Movement.GetResolvedDirectionLocal().x * inputMagnitude);
|
||||
modelAnimator.SetFloat("Move Direction Y", Unit.Movement.GetResolvedDirectionLocal().y * inputMagnitude);
|
||||
} catch (Exception e) {
|
||||
Debug.LogError($"Failed in setting X and Y move direction floats: {e.Message}");
|
||||
}
|
||||
// try {
|
||||
// inputMagnitude = Mathf.MoveTowards(inputMagnitude, GetComponent<PlayerControls>().rawMoveInput.magnitude * 2f, 6f * Time.deltaTime);
|
||||
//
|
||||
// modelAnimator.SetFloat("Move Direction X", Unit.Movement.GetResolvedDirectionLocal().x * inputMagnitude);
|
||||
// modelAnimator.SetFloat("Move Direction Y", Unit.Movement.GetResolvedDirectionLocal().y * inputMagnitude);
|
||||
// } catch (Exception e) {
|
||||
// Debug.LogError($"Failed in setting X and Y move direction floats: {e.Message}");
|
||||
// }
|
||||
|
||||
|
||||
modelAnimator.SetFloat("Move Direction X", moveSpeed);
|
||||
}
|
||||
|
||||
private void LateUpdate(){
|
||||
|
||||
Reference in New Issue
Block a user