Exemplo n.º 1
0
    private void OnEnable()
    {
        PlaneMesh = (PlaneMesh)target;

        PlaneMesh.SPData = PlaneMesh.gameObject.transform.GetComponent <SplinePlus>().sPData;

        if (PlaneMesh.MeshHolder == null)
        {
            var meshHolder = SplinePlusAPI.AddMeshHolder(PlaneMesh.SPData, "PlaneMesh");
            PlaneMesh.MeshHolder   = meshHolder;
            PlaneMesh.MeshRenderer = meshHolder.GetComponent <MeshRenderer>();
            PlaneMesh.Mesh         = meshHolder.GetComponent <MeshFilter>();
        }
        if (Delete == null)
        {
            Delete = new GUIContent((Texture2D)EditorGUIUtility.Load(SplinePlusEditor.FindAssetPath("Delete.png")));
        }

        if (PlaneMesh.Material == null)
        {
            PlaneMesh.Material = (Material)EditorGUIUtility.Load(SplinePlusEditor.FindAssetPath("Base.mat"));
            if (PlaneMesh.Material == null)
            {
                Debug.Log("mat null");
            }
        }
        PlaneMesh.SPData.MeshModifier = PlaneMesh;

        PlaneMesh.DrawMesh();
        SplineCreationClass.Update_Spline += Update_Spline;
    }
Exemplo n.º 2
0
 void Update_Spline()
 {
     PlaneMesh.DrawMesh();
 }