public override void OnInspectorGUI() { // 官方说要先这样 DrawDefaultInspector(); if (GUILayout.Button("Apply")) { CGrid g = target as CGrid; g.Reposition(); EditorUtility.SetDirty(g); } }