Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / AI / Navmesh / Conditions / LookAroundCondition.cs
@Rackday Rackday on 21 Aug 519 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName ="Finite State Machine/Condition/Look Around")]
public class LookAroundCondition : Condition
{
    protected override bool Test(FiniteStateMachine fsm)
    {
        ILookAround stalker = fsm.GetComponentInChildren<ILookAround>();
        if (stalker != null)
        {
            return stalker.isObserving == fsm.target.gameObject;
        } else
        {
            return false;
        }
        
    }
}