浏览代码

Temporary work on workbench

/feature-workbench
Thomas ICHÉ 6 年前
当前提交
ae2ae3a7
共有 6 个文件被更改,包括 17 次插入15 次删除
  1. 4
      com.unity.vfx-toolbox/Workbench/Editor/Tools/FlowMapPainter.cs
  2. 4
      com.unity.vfx-toolbox/Workbench/Editor/Tools/NoiseGenerator.cs
  3. 4
      com.unity.vfx-toolbox/Workbench/Editor/Tools/ProgressionMapGenerator.cs
  4. 2
      com.unity.vfx-toolbox/Workbench/Editor/WorkbenchBehaviourFactory.cs
  5. 2
      com.unity.vfx-toolbox/Workbench/Editor/WorkbenchInspector.cs
  6. 16
      com.unity.vfx-toolbox/Workbench/Editor/WorkbenchToolBase.cs

4
com.unity.vfx-toolbox/Workbench/Editor/Tools/FlowMapPainter.cs


return bchanged;
}
public override void Default(WorkbenchBehaviour asset)
public override void AttachToBehaviour(WorkbenchBehaviour asset)
base.Default(asset);
base.AttachToBehaviour(asset);
PaintDataWidth = 256;
PaintDataHeight = 256;
ViewMode = FlowMapPainterViewMode.Texture;

4
com.unity.vfx-toolbox/Workbench/Editor/Tools/NoiseGenerator.cs


RenderTexture.ReleaseTemporary(m_RenderTexture);
}
public override void Default(WorkbenchBehaviour asset)
public override void AttachToBehaviour(WorkbenchBehaviour asset)
base.Default(asset);
base.AttachToBehaviour(asset);
Width = 256;
Height = 256;
Depth = 5;

4
com.unity.vfx-toolbox/Workbench/Editor/Tools/ProgressionMapGenerator.cs


return bchanged;
}
public override void Default(WorkbenchBehaviour asset)
public override void AttachToBehaviour(WorkbenchBehaviour asset)
base.Default(asset);
base.AttachToBehaviour(asset);
PaintDataWidth = 256;
PaintDataHeight = 256;
PreviewMode = ViewMode.BaseTexture;

2
com.unity.vfx-toolbox/Workbench/Editor/WorkbenchBehaviourFactory.cs


if(tool != null)
{
AssetDatabase.AddObjectToAsset(tool, asset);
tool.Default(asset);
tool.AttachToBehaviour(asset);
tool.name = tool.GetType().Name;
tool.hideFlags = HideFlags.HideInHierarchy;
EditorUtility.SetDirty(asset);

2
com.unity.vfx-toolbox/Workbench/Editor/WorkbenchInspector.cs


DestroyImmediate(tool.objectReferenceValue,true);
var newTool = CreateInstance((Type)type);
AssetDatabase.AddObjectToAsset(newTool, serializedObject.targetObject);
(newTool as WorkbenchToolBase).Default((WorkbenchBehaviour)serializedObject.targetObject);
(newTool as WorkbenchToolBase).AttachToBehaviour((WorkbenchBehaviour)serializedObject.targetObject);
newTool.name = ((Type)type).Name;
newTool.hideFlags = HideFlags.HideInHierarchy;
tool.objectReferenceValue = newTool;

16
com.unity.vfx-toolbox/Workbench/Editor/WorkbenchToolBase.cs


protected WorkbenchBehaviour m_Asset;
protected WorkbenchCanvasBase m_Canvas;
public abstract bool OnInspectorGUI();
public virtual void Default(WorkbenchBehaviour asset)
public abstract void Dispose();
public abstract void Update();
// Attachs the tool to the behaviour
public virtual void AttachToBehaviour(WorkbenchBehaviour asset)
{
m_Asset = asset;
asset.tool = this;

public abstract bool OnInspectorGUI();
public abstract bool OnCanvasGUI(WorkbenchImageCanvas canvas);
public abstract void Dispose();
public abstract bool OnCanvasGUI(WorkbenchImageCanvas canvas);
public abstract void Update();
public static string GetCategory(Type t)
{

正在加载...
取消
保存