Jens Holm
7 年前
当前提交
ae1852e9
共有 8 个文件被更改,包括 174 次插入 和 117 次删除
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardField.cs
-
5MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardProvider.cs
-
59MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/WindowDraggable.cs
-
43MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs
-
105MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/WindowDockingLayout.cs
-
11MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/WindowDockingLayout.cs.meta
-
65MaterialGraphProject/Assets/TestAssets/RockMaterial1.sbsar.meta
|
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph.Drawing |
|||
{ |
|||
[Serializable] |
|||
public class WindowDockingLayout |
|||
{ |
|||
[SerializeField] |
|||
bool m_DockingLeft; |
|||
|
|||
public bool dockingLeft |
|||
{ |
|||
get { return m_DockingLeft; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
bool m_DockingTop; |
|||
|
|||
public bool dockingTop |
|||
{ |
|||
get { return m_DockingTop; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
float m_VerticalOffset; |
|||
|
|||
public float verticalOffset |
|||
{ |
|||
get { return m_VerticalOffset; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
float m_HorizontalOffset; |
|||
|
|||
public float horizontalOffset |
|||
{ |
|||
get { return m_HorizontalOffset; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
Vector2 m_Size; |
|||
|
|||
public Vector2 size |
|||
{ |
|||
get { return m_Size; } |
|||
} |
|||
|
|||
public void CalculateDockingCornerAndOffset(Rect layout, Rect parentLayout) |
|||
{ |
|||
Vector2 layoutCenter = new Vector2(layout.x + layout.width * .5f, layout.y + layout.height * .5f); |
|||
layoutCenter /= parentLayout.size; |
|||
|
|||
m_DockingLeft = layoutCenter.x < .5f; |
|||
m_DockingTop = layoutCenter.y < .5f; |
|||
|
|||
if (m_DockingLeft) |
|||
{ |
|||
m_HorizontalOffset = layout.x; |
|||
} |
|||
else |
|||
{ |
|||
m_HorizontalOffset = parentLayout.width - layout.x - layout.width; |
|||
} |
|||
|
|||
if (m_DockingTop) |
|||
{ |
|||
m_VerticalOffset = layout.y; |
|||
} |
|||
else |
|||
{ |
|||
m_VerticalOffset = parentLayout.height - layout.y - layout.height; |
|||
} |
|||
|
|||
m_Size = layout.size; |
|||
} |
|||
|
|||
public Rect GetLayout(Rect parentLayout) |
|||
{ |
|||
Rect layout = new Rect(); |
|||
|
|||
layout.size = size; |
|||
|
|||
if (dockingLeft) |
|||
{ |
|||
layout.x = horizontalOffset; |
|||
} |
|||
else |
|||
{ |
|||
layout.x = parentLayout.width - size.x - horizontalOffset; |
|||
} |
|||
|
|||
if (dockingTop) |
|||
{ |
|||
layout.y = verticalOffset; |
|||
} |
|||
else |
|||
{ |
|||
layout.y = parentLayout.height - size.y - verticalOffset; |
|||
} |
|||
|
|||
return layout; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5f70875ecccbc924b8f9f0d58bbb37e8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b69a7e88e13e24260acb38513f619ff2 |
|||
timeCreated: 1495753980 |
|||
licenseType: Pro |
|||
SubstanceImporter: |
|||
serializedVersion: 5 |
|||
materialInstances: |
|||
- serializedVersion: 16 |
|||
name: RockMaterial1 |
|||
prototypeName: RockMaterial1 |
|||
shaderName: |
|||
shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} |
|||
shaderKeywords: |
|||
renderQueue: -1 |
|||
lightmapFlags: 4 |
|||
inputs: [] |
|||
materialInformation: |
|||
serializedVersion: 5 |
|||
offset: {x: 0, y: 0} |
|||
scale: {x: 1, y: 1} |
|||
generateMipmaps: 1 |
|||
generateAllOutputs: 0 |
|||
animationUpdateRate: 0 |
|||
materialProperties: |
|||
serializedVersion: 3 |
|||
texEnvs: [] |
|||
floats: [] |
|||
colors: [] |
|||
textureParameters: |
|||
- name: RockMaterial1_basecolor |
|||
alphaSource: 6 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
wrapMode: 0 |
|||
- name: RockMaterial1_normal |
|||
alphaSource: 0 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
wrapMode: 0 |
|||
- name: RockMaterial1_metallic |
|||
alphaSource: 7 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
wrapMode: 0 |
|||
textureAssignments: |
|||
- shaderProp: _MainTex |
|||
material: {instanceID: 0} |
|||
baseUID: 779270956 |
|||
- shaderProp: _BumpMap |
|||
material: {instanceID: 0} |
|||
baseUID: 779270958 |
|||
- shaderProp: _MetallicGlossMap |
|||
material: {instanceID: 0} |
|||
baseUID: 779270954 |
|||
buildTargetSettings: |
|||
- serializedVersion: 2 |
|||
buildTarget: |
|||
textureWidth: 512 |
|||
textureHeight: 512 |
|||
textureFormat: 0 |
|||
loadingBehavior: 1 |
|||
deletedPrototypes: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue