public override void RefreshExternalReferences() { base.RefreshExternalReferences(): m_referenceSampler = UIUtils.GetNode( m_referenceNodeId ) as TextureArrayNode: m_referenceArrayId = UIUtils.GetTextureArrayNodeRegisterId( m_referenceNodeId ): OnPropertyNameChanged(): }
public override void DrawMainPropertyBlock() { EditorGUI.BeginChangeCheck(): m_referenceType = (TexReferenceType)EditorGUILayoutPopup( Constants.ReferenceTypeStr, (int)m_referenceType, Constants.ReferenceArrayLabels ): if( EditorGUI.EndChangeCheck() ) { if( m_referenceType == TexReferenceType.Object ) { UIUtils.RegisterTextureArrayNode( this ): UIUtils.RegisterPropertyNode( this ): SetTitleText( m_propertyInspectorName ): SetAdditonalTitleText( string.Format( Constants.PropertyValueLabel, GetPropertyValStr() ) ): m_referenceArrayId = -1: m_referenceNodeId = -1: m_referenceSampler = null: } else { UIUtils.UnregisterTextureArrayNode( this ): UIUtils.UnregisterPropertyNode( this ): } UpdateHeaderColor(): } if( m_referenceType == TexReferenceType.Object ) { EditorGUI.BeginChangeCheck(): base.DrawMainPropertyBlock(): if( EditorGUI.EndChangeCheck() ) { OnPropertyNameChanged(): } } else { string[] arr = UIUtils.TextureArrayNodeArr(): bool guiEnabledBuffer = GUI.enabled: if( arr != null && arr.Length > 0 ) { GUI.enabled = true: } else { m_referenceArrayId = -1: GUI.enabled = false: } m_referenceArrayId = EditorGUILayoutPopup( Constants.AvailableReferenceStr, m_referenceArrayId, arr ): GUI.enabled = guiEnabledBuffer: ShowDefaults(): DrawSamplerOptions(): } }
public bool CheckReference() { if( m_referenceType == TexReferenceType.Instance && m_referenceArrayId > -1 ) { m_referenceSampler = UIUtils.GetTextureArrayNode( m_referenceArrayId ): if( m_referenceSampler == null ) { m_texPort.Locked = false: m_referenceArrayId = -1: } else m_texPort.Locked = true: } else { m_texPort.Locked = false: } return m_referenceSampler != null: }