Ejemplo n.º 1
0
    GameObject ShowGuideArea(List <Vector2> moveable)
    {
        if (moveable == null)
        {
            return(null);
        }
        if (moveable.Count == 0)
        {
            return(null);
        }

        GameObject area   = new GameObject("GuideArea");
        Transform  parent = this.transform.parent;

        area.transform.SetParent(parent, false);

        foreach (Vector2 pos in moveable)
        {
            GameObject go = InstantiateMoveableArea(area.transform, pos);
            if (go == null)
            {
                continue;
            }
            GuideArea guide = go.GetComponent <GuideArea>();
            guide.RegistPiece(this);
        }

        return(area);
    }
Ejemplo n.º 2
0
    public void CloseGuideArea()
    {
        Transform parent = GameBoard.Instance.transform;
        Transform target = parent.GetChild(parent.childCount - 1);
        string    s      = target.gameObject.name;

        if (s == "GuideArea")
        {
            if (target.childCount > 0)
            {
                GuideArea ga = target.GetChild(0).GetComponent <GuideArea>();
                ga.Close();
            }
        }
    }