diff --git a/Assets/Scripts/Pal3/Actor/ActorController.cs b/Assets/Scripts/Pal3/Actor/ActorController.cs index e491ccaa..39dce290 100644 --- a/Assets/Scripts/Pal3/Actor/ActorController.cs +++ b/Assets/Scripts/Pal3/Actor/ActorController.cs @@ -38,8 +38,11 @@ namespace Pal3.Actor get => _actor.IsActive; set { - _actor.IsActive = value; - if (value) Activate(); + if (value) + { + Activate(); + _actor.IsActive = true; + } else DeActivate(); } } @@ -98,24 +101,28 @@ namespace Pal3.Actor return; } - switch (_actor.Info.InitBehaviour) + // Perform init action + if (!_actor.IsActive) { - case ScnActorBehaviour.None: - _currentBehaviour = ScnActorBehaviour.None; - _actionController.PerformAction(_actor.GetInitAction()); - break; - case ScnActorBehaviour.Hold: - _currentBehaviour = ScnActorBehaviour.Hold; - _actionController.PerformAction(_actor.GetInitAction()); - break; - case ScnActorBehaviour.Wander: - _currentBehaviour = ScnActorBehaviour.Wander; - _actionController.PerformAction(_actor.GetIdleAction()); - break; - case ScnActorBehaviour.PathFollow: - _currentBehaviour = ScnActorBehaviour.PathFollow; - _actionController.PerformAction(_actor.GetIdleAction()); - break; + switch (_actor.Info.InitBehaviour) + { + case ScnActorBehaviour.None: + _currentBehaviour = ScnActorBehaviour.None; + _actionController.PerformAction(_actor.GetInitAction()); + break; + case ScnActorBehaviour.Hold: + _currentBehaviour = ScnActorBehaviour.Hold; + _actionController.PerformAction(_actor.GetInitAction()); + break; + case ScnActorBehaviour.Wander: + _currentBehaviour = ScnActorBehaviour.Wander; + _actionController.PerformAction(_actor.GetIdleAction()); + break; + case ScnActorBehaviour.PathFollow: + _currentBehaviour = ScnActorBehaviour.PathFollow; + _actionController.PerformAction(_actor.GetIdleAction()); + break; + } } if (_currentBehaviour == ScnActorBehaviour.PathFollow) diff --git a/Assets/Scripts/Pal3/Actor/ActorMovementController.cs b/Assets/Scripts/Pal3/Actor/ActorMovementController.cs index fdc3b4f9..64a6461e 100644 --- a/Assets/Scripts/Pal3/Actor/ActorMovementController.cs +++ b/Assets/Scripts/Pal3/Actor/ActorMovementController.cs @@ -466,7 +466,7 @@ namespace Pal3.Actor _tilemap.GetWorldPosition(position, _currentLayerIndex), }; - SetupPath(directWayPoints, mode, endOfPathAction, ignoreObstacle: true); + SetupPath(directWayPoints, mode, endOfPathAction, ignoreObstacle: true, specialAction); } else {