Пример #1
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();
        {
            Target  = (T)target;
            Targets = targets.Select(t => (T)t).ToArray();

            Separator();

            OnInspector();

            Separator();

            serializedObject.ApplyModifiedProperties();
        }
        if (EditorGUI.EndChangeCheck() == true)
        {
            GUI.changed = true; Repaint();

            foreach (var t in Targets)
            {
                VA_Helper.SetDirty(t);
            }
        }
    }
Пример #2
0
    protected void DirtyEach(System.Action <T> update)
    {
        foreach (var t in Targets)
        {
            update(t);

            VA_Helper.SetDirty(t);
        }
    }
Пример #3
0
    public virtual void OnSceneGUI()
    {
        Target = (T)target;

        OnScene();

        if (GUI.changed == true)
        {
            VA_Helper.SetDirty(target);
        }
    }
Пример #4
0
    protected void DrawDefault(string propertyPath, bool autoApply = true)
    {
        EditorGUI.BeginChangeCheck();
        {
            EditorGUILayout.BeginVertical(VA_Helper.NoError);
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty(propertyPath), true);
            }
            EditorGUILayout.EndVertical();
        }
        if (EditorGUI.EndChangeCheck() == true)
        {
            if (autoApply == true)
            {
                serializedObject.ApplyModifiedProperties();
            }

            for (var i = Targets.Length - 1; i >= 0; i--)
            {
                VA_Helper.SetDirty(Targets[i]);
            }
        }
    }