浏览代码

Move stuff out from Views and Presenters in Drawing/Inspector

/main
Peter Bay Bastian 7 年前
当前提交
960a174b
共有 18 个文件被更改,包括 52 次插入6 次删除
  1. 52
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorPresenter.cs
  2. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Presenters.meta
  3. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views.meta
  4. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorPresenter.cs.meta
  5. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs.meta
  6. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/StandardNodeEditorView.cs.meta
  7. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs.meta
  8. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/AbstractNodeEditorView.cs.meta
  9. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/SurfaceMasterNodeEditorView.cs.meta
  10. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/NodeEditorHeaderView.cs
  11. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/NodeEditorHeaderView.cs.meta
  12. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/AbstractNodeEditorView.cs
  13. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
  14. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs
  15. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/StandardNodeEditorView.cs
  16. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/SurfaceMasterNodeEditorView.cs

52
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorPresenter.cs


using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Graphing;
namespace UnityEditor.MaterialGraph.Drawing.Inspector
{
public class GraphInspectorPresenter : ScriptableObject
{
public IGraph graph { get; set; }
public string assetName { get; set; }
public List<INode> selectedNodes { get; set; }
[Flags]
public enum ChangeType
{
Graph = 1 << 0,
SelectedNodes = 1 << 1,
AssetName = 1 << 2,
All = -1
}
public delegate void OnChange(ChangeType changeType);
public OnChange onChange;
public void Initialize(string assetName, IGraph graph)
{
this.graph = graph;
this.assetName = assetName;
selectedNodes = new List<INode>();
Change(ChangeType.Graph | ChangeType.SelectedNodes | ChangeType.AssetName);
}
public void UpdateSelection(IEnumerable<INode> nodes)
{
selectedNodes.Clear();
selectedNodes.AddRange(nodes);
Change(ChangeType.SelectedNodes);
}
void Change(ChangeType changeType)
{
if (onChange != null)
onChange(changeType);
}
}
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Presenters.meta


fileFormatVersion: 2
guid: 2d08dfb360644031a5e64558d4a93263
timeCreated: 1503663071

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views.meta


fileFormatVersion: 2
guid: 0969ff891b874694aa732e1240ee159b
timeCreated: 1503663067

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Presenters/GraphInspectorPresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorPresenter.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/IMGUISlotEditorView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/StandardNodeEditorView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/StandardNodeEditorView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/GraphInspectorView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/AbstractNodeEditorView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/AbstractNodeEditorView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/SurfaceMasterNodeEditorView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/SurfaceMasterNodeEditorView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/NodeEditorHeaderView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/NodeEditorHeaderView.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/NodeEditorHeaderView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/NodeEditorHeaderView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/AbstractNodeEditorView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/AbstractNodeEditorView.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/GraphInspectorView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/IMGUISlotEditorView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/StandardNodeEditorView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/StandardNodeEditorView.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/SurfaceMasterNodeEditorView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/SurfaceMasterNodeEditorView.cs

正在加载...
取消
保存