Movement WORKS YAY
This commit is contained in:
1 parent
7098d938a7
commit
739d1f0374
68 files changed
+70968
-10846
No files matched your search
@@ -1,24 +1,38 @@
|
||||
using System.Threading;
|
||||
using Code.Game.Gameplay.Player;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Input;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Actions.Player
|
||||
{
|
||||
public class PlayerTimelineActor : EntityTimelineActor
|
||||
{
|
||||
private void Awake()
|
||||
[Inject]
|
||||
private void Construct(
|
||||
CameraStateMachine cameraStateMachine,
|
||||
IInputService inputService,
|
||||
PlayerMovementController playerMovementController)
|
||||
{
|
||||
BattleActions.Add(BattleActionType.Wait, new BattleActionWait());
|
||||
BattleActions.Add(BattleActionType.Move, new BattleActionMove(cameraStateMachine, inputService, playerMovementController));
|
||||
}
|
||||
|
||||
public override async UniTask DecideAction(CancellationToken ct)
|
||||
{
|
||||
var decidedAction = BattleActionType.Wait; // T
|
||||
|
||||
Debug.Log("player decided to wait");
|
||||
|
||||
await BattleActions[decidedAction].DecideAction();
|
||||
|
||||
bool succeded = false;
|
||||
|
||||
var decidedAction = BattleActionType.Move; // T
|
||||
|
||||
while (!succeded || ct.IsCancellationRequested)
|
||||
{
|
||||
Debug.Log("player decided to move");
|
||||
|
||||
succeded = await BattleActions[decidedAction].DecideAction();
|
||||
}
|
||||
|
||||
CurrentAction = BattleActions[decidedAction];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user