예제 #1
0
    public void DoHighLightPathTo(TileStatus tile)
    {
        tile.SetTarget(true);
        GetPlayerStatusScript().SetMoving(false);
        GetPlayerStatusScript().SetShowingPath(true);

        TileStatus next = tile;

        while (next != null)
        {
            next.SetPath(true);
            next.SetTarget(false);

            GetPath().Push(next.GetComponent <TileBFSScript>());
            if (next.GetComponent <TileBFSScript>().GetParent())
            {
                next = next.GetComponent <TileBFSScript>().GetParent().GetComponent <TileStatus>();
            }
            else
            {
                next = null;
            }
        }
        //Debug.Log("path.Count: "+path.Count);
    }
예제 #2
0
    /*void DoInteract(RaycastHit hit, int index)
     * {
     *  Item t = hit.collider.GetComponent<Item>();
     *  InteractWithItem(t, index);
     * }*/


    void DoMove(RaycastHit hit)
    {
        //Debug.Log("DoMove(" + hit + ") called");
        TileStatus t = hit.collider.GetComponent <TileStatus>();

        if ((t.IsPath() && GetPlayerStatusScript().IsShowingPath()) || (t.IsSelectable() && !GetPlayerStatusScript().IsShowingPath()))
        {
            MoveToTile(t.GetComponent <TileBFSScript>());
        }
    }
예제 #3
0
    //private TileBFSScript pathDestination;

    public void CheckHighlightPath(/*RaycastHit hit*/)
    {
        TileStatus t = this.GetComponent <TileStatus>();

        if (t.IsSelectable())
        {
            TurnManager.GetCurrentPlayer().GetComponent <PlayerActionScript>().SetPathDestination(t.GetComponent <TileBFSScript>());
            //pathDestination = t.GetComponent<TileBFSScript>();
            HighlightPathTo(t);
        }
    }