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(); if (!interdimensionalCharacterController) { return false; } int currentAmountOfEnteranceIntoGhostView = interdimensionalCharacterController.CurrentAmountOfGhostModeEnterance; if (currentAmountOfEnteranceIntoGhostView < AmountOfEnterance) { return true; } return false; } } }