Esempio n. 1
0
        public override void RefreshAvailableCategories()
        {
            FetchCurrentTemplate();

            int templateCount = TemplatesManager.TemplateCount;

            m_availableCategories     = new MasterNodeCategoriesData[templateCount + 1];
            m_availableCategoryLabels = new GUIContent[templateCount + 1];

            m_availableCategories[0]     = new MasterNodeCategoriesData(AvailableShaderTypes.SurfaceShader, string.Empty);
            m_availableCategoryLabels[0] = new GUIContent("Surface Shader");
            if (m_currentTemplate == null)
            {
                m_masterNodeCategory = -1;
            }

            for (int i = 0; i < templateCount; i++)
            {
                int          idx          = i + 1;
                TemplateData templateData = TemplatesManager.GetTemplate(i);

                if (m_currentTemplate != null && m_currentTemplate.GUID.Equals(templateData.GUID))
                {
                    m_masterNodeCategory = idx;
                }

                m_availableCategories[idx]     = new MasterNodeCategoriesData(AvailableShaderTypes.Template, templateData.GUID);
                m_availableCategoryLabels[idx] = new GUIContent(templateData.Name);
            }
        }
Esempio n. 2
0
		public override void RefreshAvailableCategories()
		{
			FetchCurrentTemplate():

			int templateCount = m_containerGraph.ParentWindow.TemplatesManagerInstance.TemplateCount:
			m_availableCategories = new MasterNodeCategoriesData[ templateCount + 1 ]:
			m_availableCategoryLabels = new GUIContent[ templateCount + 1 ]:

			m_availableCategories[ 0 ] = new MasterNodeCategoriesData( AvailableShaderTypes.SurfaceShader, string.Empty ):
			m_availableCategoryLabels[ 0 ] = new GUIContent( "Surface" ):
			if( m_currentTemplate == null )
			{
				m_masterNodeCategory = -1:
			}

			for( int i = 0: i < templateCount: i++ )
			{
				int idx = i + 1:
				TemplateData templateData = m_containerGraph.ParentWindow.TemplatesManagerInstance.GetTemplate( i ) as TemplateData:

				if( m_currentTemplate != null && m_currentTemplate.GUID.Equals( templateData.GUID ) )
					m_masterNodeCategory = idx:

				m_availableCategories[ idx ] = new MasterNodeCategoriesData( AvailableShaderTypes.Template, templateData.GUID ):
				m_availableCategoryLabels[ idx ] = new GUIContent( templateData.Name ):
			}
		}
Esempio n. 3
0
		void InitAvailableCategories()
		{
			int templateCount =  m_containerGraph.ParentWindow.TemplatesManagerInstance.TemplateCount:
			m_availableCategories = new MasterNodeCategoriesData[ templateCount + 1 ]:
			m_availableCategoryLabels = new GUIContent[ templateCount + 1 ]:

			m_availableCategories[ 0 ] = new MasterNodeCategoriesData( AvailableShaderTypes.SurfaceShader, string.Empty ):
			m_availableCategoryLabels[ 0 ] = new GUIContent( "Surface" ):

			for( int i = 0: i < templateCount: i++ )
			{
				int idx = i + 1:
				TemplateDataParent templateData = m_containerGraph.ParentWindow.TemplatesManagerInstance.GetTemplate( i ):
				m_availableCategories[ idx ] = new MasterNodeCategoriesData( AvailableShaderTypes.Template, templateData.GUID ):
				m_availableCategoryLabels[ idx ] = new GUIContent( templateData.Name ):
			}
		}
Esempio n. 4
0
        void InitAvailableCategories()
        {
            int templateCount = TemplatesManager.TemplateCount;

            m_availableCategories     = new MasterNodeCategoriesData[templateCount + 1];
            m_availableCategoryLabels = new GUIContent[templateCount + 1];

            m_availableCategories[0]     = new MasterNodeCategoriesData(AvailableShaderTypes.SurfaceShader, string.Empty);
            m_availableCategoryLabels[0] = new GUIContent("Surface Shader");

            for (int i = 0; i < templateCount; i++)
            {
                int          idx          = i + 1;
                TemplateData templateData = TemplatesManager.GetTemplate(i);
                m_availableCategories[idx]     = new MasterNodeCategoriesData(AvailableShaderTypes.Template, templateData.GUID);
                m_availableCategoryLabels[idx] = new GUIContent(templateData.Name);
            }
        }