51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using UnityEngine;
|
|
|
|
namespace Invector.vCharacterController.AI.FSMBehaviour
|
|
{
|
|
#if UNITY_EDITOR
|
|
[vFSMHelpbox("This is a CheckGhostDimensionEnteranceAvailable decision", UnityEditor.MessageType.Info)]
|
|
#endif
|
|
public class CheckGhostDimensionEnteranceAvailable : vStateDecision
|
|
{
|
|
public int AmountOfEnterance = 0;
|
|
public override string categoryName
|
|
{
|
|
get { return "MyCustomDecisions/"; }
|
|
}
|
|
|
|
public override string defaultName
|
|
{
|
|
get { return "CheckGhostDimensionEnteranceAvailable"; }
|
|
}
|
|
|
|
public override bool Decide(vIFSMBehaviourController fsmBehaviour)
|
|
{
|
|
return CheckValue(fsmBehaviour);
|
|
}
|
|
|
|
protected virtual bool CheckValue(vIFSMBehaviourController fsmBehaviour)
|
|
{
|
|
if (fsmBehaviour == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var interdimensionalCharacterController = fsmBehaviour.gameObject.GetComponent<InterdimensionalCharacterController>();
|
|
|
|
if (!interdimensionalCharacterController)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
int currentAmountOfEnteranceIntoGhostView = interdimensionalCharacterController.CurrentAmountOfGhostModeEnterance;
|
|
|
|
if (currentAmountOfEnteranceIntoGhostView < AmountOfEnterance)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|