Exemplo n.º 1
0
    public bool CanMove(float x, float y)
    {
        string temp = scriptM.FindTile(transform.position.x, transform.position.z, transform.position.y - 1.0f);

        if (temp == "none")
        {
            //Debug.Log("failed");
            return(false);
        }
        string i = "north";

        if (x > 0)
        {
            Debug.Log("E");
            i = "east";
        }
        else if (x < 0)
        {
            Debug.Log("W");
            i = "west";
        }
        if (y > 0)
        {
            Debug.Log("N");
            i = "north";
        }
        else if (y < 0)
        {
            Debug.Log("S");
            i = "south";
        }


        return(scriptM.CanMove(transform.position.x, transform.position.z, transform.position.y, i));;
    }