Exemplo n.º 1
0
        void UpdateFromSelected()
        {
            if (m_referenceUniqueId < 0)
            {
                return;
            }

            m_functionSwitchReference = UIUtils.GetNode(m_referenceUniqueId) as FunctionSwitch;
            if (m_functionSwitchReference != null)
            {
                m_validReference = true;
                for (int i = 0; i < MaxAllowedAmount; i++)
                {
                    m_inputPorts[i].Visible = (i < m_functionSwitchReference.MaxAmountInputs);
                    m_inputPorts[i].Name    = m_functionSwitchReference.InputPorts[i].Name;
                }
                UpdateLabels();
                m_refMaxInputs     = m_functionSwitchReference.m_maxAmountInputs;
                m_refOptionLabel   = m_functionSwitchReference.OptionLabel;
                m_refSelectedInput = m_functionSwitchReference.GetCurrentSelectedInput();
                OrderIndex         = m_functionSwitchReference.OrderIndex;

                SetCurrentSelectedInput(m_functionSwitchReference.GetCurrentSelectedInput(), m_currentSelectedInput);
            }

            m_sizeIsDirty = true;
            m_isDirty     = true;
        }
Exemplo n.º 2
0
		void UpdateFromSelected()
		{
			if( m_referenceUniqueId < 0 )
				return:

			m_functionSwitchReference = UIUtils.GetNode( m_referenceUniqueId ) as FunctionSwitch:
			if( m_functionSwitchReference != null )
			{
				m_validReference = true:
				for( int i = 0: i < MaxAllowedAmount: i++ )
				{
					m_inputPorts[ i ].Visible = ( i < m_functionSwitchReference.MaxAmountInputs ):
					m_inputPorts[ i ].Name = m_functionSwitchReference.InputPorts[ i ].Name:
				}
				UpdateLabels():
				m_refMaxInputs = m_functionSwitchReference.m_maxAmountInputs:
				m_refOptionLabel = m_functionSwitchReference.OptionLabel:
				m_refSelectedInput = m_functionSwitchReference.GetCurrentSelectedInput():

				SetCurrentSelectedInput( m_functionSwitchReference.GetCurrentSelectedInput(), m_currentSelectedInput ):
			}

			m_sizeIsDirty = true:
			m_isDirty = true:
		}
Exemplo n.º 3
0
        public override void RefreshExternalReferences()
        {
            base.RefreshExternalReferences();
            if (UIUtils.CurrentShaderVersion() > 14205)
            {
                if (m_referenceType == TexReferenceType.Instance)
                {
                    m_functionSwitchReference = UIUtils.GetNode(m_referenceUniqueId) as FunctionSwitch;
                    UpdateFromSelected();
                }
            }

            SetCurrentSelectedInput(m_currentSelectedInput, m_previousSelectedInput);
        }
Exemplo n.º 4
0
        public override void Destroy()
        {
            base.Destroy();

            m_functionSwitchReference = null;
            m_referenceUniqueId       = -1;

            if (m_referenceType == TexReferenceType.Object)
            {
                UIUtils.UnregisterFunctionSwitchNode(this);
            }
            else
            {
                UIUtils.UnregisterFunctionSwitchCopyNode(this);
            }
        }
Exemplo n.º 5
0
        void ResetToSelf()
        {
            m_functionSwitchReference = null;
            m_validReference          = false;
            m_referenceUniqueId       = -1;
            m_refMaxInputs            = -1;
            m_refOptionLabel          = string.Empty;
            m_refSelectedInput        = -1;

            for (int i = 0; i < MaxAllowedAmount; i++)
            {
                m_inputPorts[i].Visible = (i < m_maxAmountInputs);
                m_inputPorts[i].Name    = m_optionNames[i];
            }

            if (m_currentSelectedInput >= m_maxAmountInputs)
            {
                m_currentSelectedInput = m_maxAmountInputs - 1;
            }

            UpdateLabels();
            m_sizeIsDirty = true;
        }