public override void RefreshExternalReferences() { base.RefreshExternalReferences(); if (m_referenceType == TexReferenceType.Instance) { if (UIUtils.CurrentShaderVersion() > 22) { m_referenceNode = UIUtils.GetNode(m_referenceNodeId) as ScreenColorNode; m_referenceArrayId = UIUtils.GetScreenColorNodeRegisterId(m_referenceNodeId); } else { m_referenceNode = UIUtils.GetScreenColorNode(m_referenceArrayId); if (m_referenceNode != null) { m_referenceNodeId = m_referenceNode.UniqueId; } } } if (UIUtils.CurrentShaderVersion() <= 14102) { if (m_inputPorts[0].DataType == WirePortDataType.FLOAT4) { m_normalize = true; } else { m_normalize = false; } } }
void CheckReference() { if (m_referenceType != TexReferenceType.Instance) { return; } if (m_referenceArrayId > -1) { ParentNode newNode = UIUtils.GetScreenColorNode(m_referenceArrayId); if (newNode == null || newNode.UniqueId != m_referenceNodeId) { m_referenceNode = null; int count = UIUtils.GetScreenColorNodeAmount(); for (int i = 0; i < count; i++) { ParentNode node = UIUtils.GetScreenColorNode(i); if (node.UniqueId == m_referenceNodeId) { m_referenceNode = node as ScreenColorNode; m_referenceArrayId = i; break; } } } } if (m_referenceNode == null && m_referenceNodeId > -1) { m_referenceNodeId = -1; m_referenceArrayId = -1; } }
public override void OnNodeLogicUpdate(DrawInfo drawInfo) { base.OnNodeLogicUpdate(drawInfo); if (m_referenceNodeId > -1 && m_referenceNode == null) { m_referenceNode = UIUtils.GetScreenColorNode(m_referenceNodeId) as ScreenColorNode; if (m_referenceNode == null) { m_referenceNodeId = -1; m_referenceArrayId = -1; m_sizeIsDirty = true; } } if (m_showSubtitle == m_containerGraph.IsSRP) { m_showSubtitle = !m_containerGraph.IsSRP; m_sizeIsDirty = true; } #if UNITY_2018_3_OR_NEWER if ((ContainerGraph.IsHDRP || ContainerGraph.ParentWindow.IsShaderFunctionWindow) && ASEPackageManagerHelper.CurrentHDVersion >= ASESRPVersions.ASE_SRP_5_13_0) { m_inputPorts[1].Visible = true; } else { m_inputPorts[1].Visible = false; } #else m_inputPorts[1].Visible = false; #endif }
public override void OnNodeLogicUpdate(DrawInfo drawInfo) { base.OnNodeLogicUpdate(drawInfo); if (m_referenceNodeId > -1 && m_referenceNode == null) { m_referenceNode = m_containerGraph.GetNode(m_referenceNodeId) as ScreenColorNode; if (m_referenceNode == null) { m_referenceNodeId = -1; m_referenceArrayId = -1; m_sizeIsDirty = true; } } }
public override void Draw(DrawInfo drawInfo) { base.Draw(drawInfo); if (m_forceNodeUpdate) { m_forceNodeUpdate = false; if (UIUtils.CurrentShaderVersion() > 22) { m_referenceNode = UIUtils.GetNode(m_referenceNodeId) as ScreenColorNode; m_referenceArrayId = UIUtils.GetScreenColorNodeRegisterId(m_referenceNodeId); } else { m_referenceNode = UIUtils.GetScreenColorNode(m_referenceArrayId); if (m_referenceNode != null) { m_referenceNodeId = m_referenceNode.UniqueId; } } } if (SoftValidReference) { m_content.text = m_referenceNode.TitleContent.text + Constants.InstancePostfixStr; m_additionalContent.text = m_referenceNode.AdditonalTitleContent.text; if (m_referenceIconStyle == null) { m_referenceIconStyle = UIUtils.GetCustomStyle(CustomStyle.SamplerTextureIcon); } Rect iconPos = m_globalPosition; iconPos.width = m_referenceIconStyle.normal.background.width * drawInfo.InvertedZoom; iconPos.height = m_referenceIconStyle.normal.background.height * drawInfo.InvertedZoom; iconPos.y += 6 * drawInfo.InvertedZoom; iconPos.x += m_globalPosition.width - iconPos.width - 7 * drawInfo.InvertedZoom; if (GUI.Button(iconPos, string.Empty, m_referenceIconStyle)) { UIUtils.FocusOnNode(m_referenceNode, 1, true); } } }
public override void RefreshExternalReferences() { if (m_referenceType == TexReferenceType.Instance) { if (UIUtils.CurrentShaderVersion() > 22) { m_referenceNode = UIUtils.GetNode(m_referenceNodeId) as ScreenColorNode; m_referenceArrayId = UIUtils.GetScreenColorNodeRegisterId(m_referenceNodeId); } else { m_referenceNode = UIUtils.GetScreenColorNode(m_referenceArrayId); if (m_referenceNode != null) { m_referenceNodeId = m_referenceNode.UniqueId; } } } }
public override void OnNodeLogicUpdate(DrawInfo drawInfo) { base.OnNodeLogicUpdate(drawInfo); if (m_referenceNodeId > -1 && m_referenceNode == null) { m_referenceNode = UIUtils.GetScreenColorNode(m_referenceNodeId) as ScreenColorNode; if (m_referenceNode == null) { m_referenceNodeId = -1; m_referenceArrayId = -1; m_sizeIsDirty = true; } } if (m_showSubtitle == m_containerGraph.IsSRP) { m_showSubtitle = !m_containerGraph.IsSRP; m_sizeIsDirty = true; } }