예제 #1
0
    //Accepts a command to display a new possible position, TODO return a failed and deal with it
    public void SetMovement(Vector3 tar)
    {
        if (performableAction != null)
        {
            performableAction.CleanHelperAction();
        }
        //Before even checking figure out if we can actually stand there
        Node tarNode = m_grid.NodeFromWorldPoint(tar);

        //Debug.Log(tar.ToString() + " " + tarNode.worldPosition.ToString());
        if (tarNode.walkable)
        {
            //m_TarX = tarNode.worldPosition;
            //targetCircle.transform.position = new Vector3 (target.x, target.y + 0.1f, target.z);
            //m_TarX.SetActive (true);
            previosUnWalkableNode.occupied = false;
            PathRequestManager.RequestPath(transform.position, tar, OnPathFound);
            m_Player.setConfirmButton(this, true);
        }
    }