Esempio n. 1
0
        public void CheckReference()
        {
            if (m_referenceType != TexReferenceType.Instance)
            {
                m_validReference = false;
                return;
            }

            if (m_functionSwitchReference == null)
            {
                m_validReference = false;
                ResetToSelf();
                return;
            }

            if (m_referenceUniqueId != m_functionSwitchReference.UniqueId)
            {
                UpdateFromSelected();
            }
            if (m_refSelectedInput != m_functionSwitchReference.GetCurrentSelectedInput() || m_refMaxInputs != m_functionSwitchReference.MaxAmountInputs || m_refOptionLabel != m_functionSwitchReference.OptionLabel)
            {
                UpdateFromSelected();
            }

            m_validReference = true;
        }
Esempio 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();
                OrderIndex         = m_functionSwitchReference.OrderIndex;

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

            m_sizeIsDirty = true;
            m_isDirty     = true;
        }
Esempio n. 3
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:
		}