Beispiel #1
0
    //Unit Example
    public void OnPathFound(Vector3[] newPath, bool pathSuccessful)
    {
        int pathLen = newPath.Length - 1;

        previosUnWalkableNode.walkable = false;
        if (pathLen <= movementLeft)
        {
            if (pathSuccessful)
            {
                Debug.Log("Path Cost " + (pathLen));
                path = newPath;

                targetIndex = 0;
                int     i   = pathLen;
                Vector3 pos = newPath [i];

                m_NPlayer.updateMoveLeftSlider(movementLeft - pathLen);
                m_NPlayer.setTarCross(new Vector3(pos.x, pos.y + circleOffset / 2, pos.z), true);
            }
            else
            {
                Debug.Log("Path Failed; Cost: " + pathLen);
            }
        }
    }