public GoapAgent(IGoap provider, IAgentActions actions, IAgentControllerState state) { _dataProvider = provider; ActionProvider = actions; StateProvider = state; _stateMachine = new FSM(); _availableActions = new HashSet <GoapAction>(); _currentActions = new Queue <GoapAction>(); _planner = new GoapPlanner(); createIdleState(); createMoveToState(); createPerformActionState(); _stateMachine.pushState(_idleState); loadActions(); }
public void SetCallbacks(IAgentActions instance) { if (m_Wrapper.m_AgentActionsCallbackInterface != null) { @Move.started -= m_Wrapper.m_AgentActionsCallbackInterface.OnMove; @Move.performed -= m_Wrapper.m_AgentActionsCallbackInterface.OnMove; @Move.canceled -= m_Wrapper.m_AgentActionsCallbackInterface.OnMove; } m_Wrapper.m_AgentActionsCallbackInterface = instance; if (instance != null) { @Move.started += instance.OnMove; @Move.performed += instance.OnMove; @Move.canceled += instance.OnMove; } }