예제 #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUI.BeginChangeCheck();
        serializedObject.UpdateIfRequiredOrScript();

        EditorGUILayout.PropertyField(s_type, new GUIContent("Tile Type"));
        EditorGUILayout.PropertyField(s_owner, new GUIContent("Owner"));

        serializedObject.ApplyModifiedProperties();

        if (GUILayout.Button("Update Tile"))
        {
            foreach (Object tar in targets)
            {
                Tile       tile   = null;
                TileEditor editor = tar as TileEditor;
                if (editor)
                {
                    tile = editor.GetComponent <Tile>();
                }
                if (tile)
                {
                    tile.ChangeTile(editor.editor_type, editor.editor_owner);
                }
                editor.ready_to_delete = true;
            }
            Selection.activeObject = null;
        }
    }