34 lines
860 B
C#
34 lines
860 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Drawing;
|
|
using Sirenix.OdinInspector;
|
|
|
|
namespace Reset.Unit{
|
|
public class UnitMovementHandler : MonoBehaviour{
|
|
private CharacterController controller;
|
|
|
|
// Move Speed
|
|
[ShowInInspector, ReadOnly] private float currentSpeed;
|
|
public float targetSpeed;
|
|
public float smoothing = 10f;
|
|
|
|
// Jumping
|
|
[ShowInInspector, ReadOnly] private float jumpPower;
|
|
public float jumpPowerDecay;
|
|
|
|
// Gravity
|
|
[ShowInInspector, ReadOnly] public float gravityPower;
|
|
public float gravityMax;
|
|
public float gravityAcceleration;
|
|
|
|
void Awake(){
|
|
|
|
}
|
|
|
|
public void DoMovement(Vector3 moveDir, float speed){
|
|
controller.Move(moveDir * speed * Time.deltaTime);
|
|
}
|
|
}
|
|
}
|
|
|