Ejemplo n.º 1
0
		public override bool Reload()
		{
			if( m_vertexDataContainer != null )
			{
				m_vertexDataContainer.Reload():
			}

			if( m_interpolatorDataContainer != null )
			{
				m_interpolatorDataContainer.Destroy():
			}

			if( m_availableShaderProperties != null )
			{
				m_availableShaderProperties.Clear():
			}

			if( m_propertyDict != null )
			{
				m_propertyDict.Clear():
			}

			if( m_propertyList != null )
			{
				m_propertyList.Clear():
			}

			if( m_inputDataDict != null )
			{
				m_inputDataDict.Clear():
			}

			if( m_inputDataList != null )
			{
				m_inputDataList.Clear():
			}

			if( m_localVarsList != null )
			{
				m_localVarsList.Clear():
			}

			//if( m_snippetElementsDict != null )
			//{
			//	m_snippetElementsDict.Clear():
			//}

			//if( m_snippetElementsList != null )
			//{
			//	for( int i = 0: i < m_snippetElementsList.Count: i++ )
			//	{
			//		GameObject.DestroyImmediate( m_snippetElementsList[ i ] ):
			//		m_snippetElementsList[ i ] = null:
			//	}
			//	m_snippetElementsList.Clear():
			//}

			string datapath = AssetDatabase.GUIDToAssetPath( m_guid ):
			string body = string.Empty:
			try
			{
				body = IOUtils.LoadTextFileFromDisk( datapath ):
				body = body.Replace( "\r\n", "\n" ):
			}
			catch( Exception e )
			{
				Debug.LogException( e ):
				m_isValid = false:
			}
			LoadTemplateBody( body ):
			if( m_communityTemplate )
			{
				Name = m_defaultShaderName:
			}
			return true:
		}
        public void Reload()
        {
            if (m_vertexDataContainer != null)
            {
                m_vertexDataContainer.Reload();
            }

            if (m_interpolatorDataContainer != null)
            {
                m_interpolatorDataContainer.Destroy();
            }

            if (m_availableShaderProperties != null)
            {
                m_availableShaderProperties.Clear();
            }

            if (m_propertyDict != null)
            {
                m_propertyDict.Clear();
            }

            if (m_propertyList != null)
            {
                m_propertyList.Clear();
            }

            if (m_inputDataDict != null)
            {
                m_inputDataDict.Clear();
            }

            if (m_inputDataList != null)
            {
                m_inputDataList.Clear();
            }

            if (m_localVarsList != null)
            {
                m_localVarsList.Clear();
            }

            //if( m_snippetElementsDict != null )
            //{
            //	m_snippetElementsDict.Clear();
            //}

            //if( m_snippetElementsList != null )
            //{
            //	for( int i = 0; i < m_snippetElementsList.Count; i++ )
            //	{
            //		GameObject.DestroyImmediate( m_snippetElementsList[ i ] );
            //		m_snippetElementsList[ i ] = null;
            //	}
            //	m_snippetElementsList.Clear();
            //}

            string datapath = AssetDatabase.GUIDToAssetPath(m_guid);
            string body     = string.Empty;

            try
            {
                body = IOUtils.LoadTextFileFromDisk(datapath);
                body = body.Replace("\r\n", "\n");
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                m_isValid = false;
            }
            LoadTemplateBody(body);
            if (m_communityTemplate)
            {
                m_name = m_defaultShaderName;
            }
        }