Beispiel #1
0
    public bool SelectVertex(int X, int Y)
    {
        sVertex v = listVertex.Find(V => V.IsVertex(X, Y));

        if (v == null)
        {
            return(false);
        }
        if (workVertex != null)
        {
            workVertex.SetInactive();
        }
        v.SetActive();
        workVertex = v;
        sHelper.GetInstance().GuideLines(v.GameObject().transform.position.x, v.GameObject().transform.position.y);
        selected = true;
        return(true);
    }
Beispiel #2
0
    public sVertex AddVertex(int X, int Y)
    {
        if (listVertex.Exists(V => V.IsVertex(X, Y)))
        {
            // Vértice já existe na estrutura
            SelectVertex(X, Y);
            return(null);
        }
        sVertex v = new sVertex(X, Y);

        listVertex.Add(v);
        v.SetActive();
        if (workVertex != null)
        {
            workVertex.SetInactive();
        }
        workVertex = v;
        sHelper.GetInstance().GuideLines(X * 0.24f, Y * 0.24f);
        selected = true;
        return(v);
    }