//------------------------------------------------------------------------------------------------------------- private void changeState(WAYPOINTSTATE _state) { m_wayPointState = _state; switch (_state) { case (WAYPOINTSTATE.OCCUPIED): HideWaypoint(); break; case (WAYPOINTSTATE.IDLE): if (WaypointRoot != null) { ActivateWayPointAsset(); } ShowWaypoint(); break; case (WAYPOINTSTATE.INACTIVE): if (WaypointRoot != null) { DeactivateWayPointAsset(); } break; } }
//------------------------------------------------------------------------------------------------------------- void Awake() { WaypointState = WAYPOINTSTATE.INACTIVE; m_player = GameObject.FindGameObjectWithTag("Player"); AddEventListeners(); }//-------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------- private void OnOccupy() { WaypointState = WAYPOINTSTATE.OCCUPIED; OnOccupiedEvent.Invoke(); }
//------------------------------------------------------------------------------------------------------------- public void OnWaypointLeave() { WaypointState = WAYPOINTSTATE.IDLE; OnLeaveEvent.Invoke(); }