示例#1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        AstroData ScriptHandler = (AstroData)target;

        if (GUILayout.Button("Update This Buffer Zones"))
        {
            ScriptHandler.EnforceMyBufferZone();
        }
    }
示例#2
0
    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();
    }