Example #1
0
 public override void UpdateMesh()
 {
     shapeGenerator.elevationMinMax = new MinMax();
     if (icoSphere == null)
     {
         Initialize();
         icoSphere.ConstructMesh();
         icoSphere.UpdateMesh();
     }
     else
     {
         icoSphere.UpdateMesh();
     }
     colorGenerator.UpdateElevation(shapeGenerator.elevationMinMax);
 }
Example #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        IcoSphere myScript = (IcoSphere)target;

        if (GUILayout.Button("Build IcoSphere"))
        {
            myScript.CreateIcosphere();
            myScript.UpdateMesh();
        }
        serializedObject.Update();
        radius.floatValue = Mathf.Max(0.5f, radius.floatValue);
        serializedObject.ApplyModifiedProperties();
    }