revival/game/Assets/Scripts/Player/PlayerAnimationController.cs

30 lines
917 B
C#
Raw Normal View History

2021-03-05 19:00:50 +01:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerAnimationController : MonoBehaviour
{
private const string IS_WALKING = "IsWalking";
private const string IN_JUMP_STATE = "InJumpState";
private const string IN_BOOST_STATE = "InBoostState";
public struct AnimationParams
{
public bool IsWalking;
public bool InJumpState;
public bool InBoostState;
}
2021-03-05 19:00:50 +01:00
[SerializeField] private Animator _animator;
[SerializeField] private CharacterController _controller;
private AnimationParams _params;
public void ProcessAnimUpdate( AnimationParams animParams )
2021-03-05 19:00:50 +01:00
{
_animator.SetBool(IS_WALKING, animParams.IsWalking);
_animator.SetBool(IN_JUMP_STATE, animParams.InJumpState);
_animator.SetBool(IN_BOOST_STATE, animParams.InBoostState);
2021-03-05 19:00:50 +01:00
}
}