This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Project Undercover/Assets/Scripts/CharacterStateMachine/ActionScripts/WaitForInteractionAcceptance.cs

27 lines
966 B
C#
Raw Normal View History

using UnityEngine;
[CreateAssetMenu(menuName = "CharacterStateMachine/Actions/WaitForInteractionAcceptance")]
public class WaitForInteractionAcceptance : Action
{
public override void StartAct(StateController controller)
{
// Todo: Remove this line once the "interaction selector" UI is finished
2017-10-08 18:37:19 -05:00
controller.SelectedInteraction = GetFirstInteraction(controller);
controller.InitiateInteractionWithSelectedObject();
ProgressPanelController.ActivePanel.Reveal(controller.SelectedInteraction.interactionDescription);
}
public override void EndAct(StateController controller)
{
//Debug.Log("Finished waiting for acceptance");
}
2017-10-08 18:37:19 -05:00
private Interaction GetFirstInteraction(StateController controller)
{
if (controller.SelectedObject.interactions.Length > 0)
return controller.SelectedObject.interactions[0];
return controller.SelectedObject.spyInteractions[0];
}
}