Ejemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        protected void Build(GameObject pParent)
        {
            vParent = pParent;

            Background = new GameObject("Background");
            Background.transform.SetParent(pParent.transform, false);
            Background.AddComponent <MeshRenderer>();
            BackgroundMesh = Background.AddComponent <MeshFilter>().mesh;
            BackgroundMesh.MarkDynamic();

            Edge = new GameObject("Edge");
            Edge.transform.SetParent(pParent.transform, false);
            Edge.AddComponent <MeshRenderer>();
            EdgeMesh = Edge.AddComponent <MeshFilter>().mesh;
            EdgeMesh.MarkDynamic();

            Highlight = new GameObject("Highlight");
            Highlight.transform.SetParent(pParent.transform, false);
            Highlight.AddComponent <MeshRenderer>();
            HighlightMesh = Highlight.AddComponent <MeshFilter>().mesh;
            HighlightMesh.MarkDynamic();

            Select = new GameObject("Select");
            Select.transform.SetParent(pParent.transform, false);
            Select.AddComponent <MeshRenderer>();
            SelectMesh = Select.AddComponent <MeshFilter>().mesh;
            SelectMesh.MarkDynamic();

            BackgroundColor = Color.clear;
            EdgeColor       = Color.clear;
            SelectColor     = Color.clear;
            HighlightColor  = Color.clear;

            UpdateAfterResize();
        }
Ejemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        HighlightMesh hm = (HighlightMesh)target;


        if (GUILayout.Button("Create Mesh"))
        {
            hm.UpdateMesh();
        }
    }