Jens Holm
7 年前
当前提交
a83bd958
共有 3 个文件被更改,包括 10 次插入 和 62 次删除
-
12com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs
-
11com.unity.shadergraph/Editor/Data/Graphs/BoundVector3MaterialSlot.cs.meta
-
49com.unity.shadergraph/Editor/Data/Graphs/BoundVector3MaterialSlot.cs
|
|||
fileFormatVersion: 2 |
|||
guid: 071050257f8429342ac57b3dfe15c0c2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEditor.Graphing; |
|||
using UnityEditor.ShaderGraph.Drawing.Slots; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.UIElements; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Serializable] |
|||
public class BoundVector3MaterialSlot : SpaceMaterialSlot |
|||
{ |
|||
[SerializeField] |
|||
private CoordinateSpace m_Space; |
|||
|
|||
public BoundVector3MaterialSlot() |
|||
{ |
|||
} |
|||
|
|||
public BoundVector3MaterialSlot( |
|||
int slotId, |
|||
string displayName, |
|||
string shaderOutputName, |
|||
Vector3 value, |
|||
CoordinateSpace space, |
|||
ShaderStage shaderStage = ShaderStage.Dynamic, |
|||
bool hidden = false) |
|||
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden) |
|||
{ |
|||
this.value = value; |
|||
} |
|||
|
|||
public override VisualElement InstantiateControl() |
|||
{ |
|||
return new LabelSlotControlView(space + " Space"); |
|||
} |
|||
|
|||
protected override string ConcreteSlotValueAsVariable(AbstractMaterialNode.OutputPrecision precision) |
|||
{ |
|||
return precision + String.Format("3 ({0}, {1}, {2})", NodeUtils.FloatToShaderValue(value.x), NodeUtils.FloatToShaderValue(value.y), NodeUtils.FloatToShaderValue(value.z)); |
|||
} |
|||
|
|||
public override void CopyValuesFrom(MaterialSlot foundSlot) |
|||
{ |
|||
var slot = foundSlot as BoundVector3MaterialSlot; |
|||
if (slot != null) |
|||
value = slot.value; |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue