Esempio n. 1
0
    private void OnEnable()
    {
        //slow the ghost down
        m_movementController.SetSpeed(m_movementController.GetSpeed() * speedMultiplier);

        //reverse direction
        m_movementController.ChangeDirection(-m_movementController.GetDirection());

        gameObject.GetComponent <Animator>().SetTrigger("flee");

        isEnabled = true;
    }
Esempio n. 2
0
    private void MoveToNextPosition()
    {
        Vector2 nextPosition = m_currentStrategy.GetNextLocation(m_target);

        Vector2 direction = GetNextDirection(nextPosition);

        m_movementController.ChangeDirection(direction);
    }
Esempio n. 3
0
 private void EnterGhostHouse()
 {
     m_movementController.m_next = m_homePosition;
     m_movementController.ChangeDirection(m_homePosition.GetDirectionToCentralNode());
     updateState = EnterGhostHouseUpdate;
 }