コード例 #1
0
ファイル: teleport.cs プロジェクト: nadavMiz/Pacman-Unleashed
    public void PacmanCollide(Collider2D _pacman)
    {
        NodeMovement pacmanMovement = _pacman.GetComponent <NodeMovement>();

        _pacman.transform.position = m_target.transform.position;

        pacmanMovement.m_previous = m_target;
        pacmanMovement.m_next     = m_target.GetNextAt(pacmanMovement.GetDirection());
    }
コード例 #2
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;
    }