files that should be commited before
This commit is contained in:
parent
e5d7120e59
commit
0203544469
@ -28,6 +28,8 @@ public class Player : MonoBehaviour,IResettable, ICommandTranslator
|
||||
#region PlayerComponents
|
||||
|
||||
[SerializeField] private PlayerData playerData;
|
||||
|
||||
private int initialSpeed;
|
||||
public IDamageable PlayerHealth { get; private set; }
|
||||
public Statistics PlayerStatictics { get; private set; }
|
||||
public PlayerData PlayerData { get { return playerData; } }
|
||||
@ -58,6 +60,7 @@ public class Player : MonoBehaviour,IResettable, ICommandTranslator
|
||||
PlayerStatictics = GetComponent<Statistics>();
|
||||
PlayerStateMachine = new PlayerStateMachine(this);
|
||||
InvincibilityTime = playerData.InvincibilityTime;
|
||||
initialSpeed = (int)playerData.Speed;
|
||||
}
|
||||
private void OnEnable()
|
||||
{
|
||||
|
@ -21,8 +21,9 @@ public abstract class MovingState : PlayerState
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
speed = playerData.Speed;
|
||||
//HandleDirection();
|
||||
playerSM.HorizontalDeltaPosition = speed * playerSM.PlayerTransform.forward * Time.deltaTime ;
|
||||
playerSM.HorizontalDeltaPosition = playerSM.PlayerTransform.forward * speed * Time.deltaTime ;
|
||||
playerSM.HorizontalDeltaPosition += playerSM.PlayerTransform.forward * speed * Time.deltaTime;
|
||||
playerSM.UpdateDistance(playerSM.HorizontalDeltaPosition.z); //вынести в контроллер
|
||||
SwitchLane();
|
||||
|
Loading…
x
Reference in New Issue
Block a user