public override void OnInspectorGUI() { DrawDefaultInspector(); AstroData ScriptHandler = (AstroData)target; if (GUILayout.Button("Update This Buffer Zones")) { ScriptHandler.EnforceMyBufferZone(); } }
public void EnforceBufferZones() { UpdateMeshesAndColliders(true); var tempList = transform.Cast <Transform>().ToList(); foreach (var child in tempList) { if (child != null) { AstroData astroData = child.GetComponent <AstroData>(); if (astroData != null) { astroData.EnforceMyBufferZone(); } } } tempList.Clear(); }