public void Destroy()
 {
     m_blendData       = null;
     m_blendData1      = null;
     m_blendData2      = null;
     m_blendData3      = null;
     m_alphaToMaskData = null;
     m_cullModeData    = null;
     m_colorMaskData   = null;
     m_colorMaskData1  = null;
     m_colorMaskData2  = null;
     m_colorMaskData3  = null;
     m_stencilData     = null;
     m_depthData       = null;
     m_tagData.Destroy();
     m_tagData         = null;
     m_globalsTag      = null;
     m_srpBatcherTag   = null;
     m_allModulesTag   = null;
     m_functionsTag    = null;
     m_pragmaTag       = null;
     m_pragmaBeforeTag = null;
     m_passTag         = null;
     m_inputsVertTag   = null;
     m_inputsFragTag   = null;
     m_includePragmaContainer.Destroy();
     m_includePragmaContainer = null;
 }
Example #2
0
        public void ConfigureFromTemplateData(TemplateBlendData blendData)
        {
            if (blendData.ValidBlendMode)
            {
                if (m_validBlendMode != blendData.ValidBlendMode)
                {
                    m_blendModeEnabled  = true;
                    m_sourceFactorRGB   = blendData.SourceFactorRGB;
                    m_destFactorRGB     = blendData.DestFactorRGB;
                    m_sourceFactorAlpha = blendData.SourceFactorAlpha;
                    m_destFactorAlpha   = blendData.DestFactorAlpha;
                    if (blendData.SeparateBlendFactors)
                    {
                        if (blendData.BlendModeOff)
                        {
                            m_currentRGBIndex = 0;
                        }
                        else
                        {
                            CheckRGBIndex();
                        }
                        CheckAlphaIndex();
                    }
                    else
                    {
                        if (blendData.BlendModeOff)
                        {
                            m_currentRGBIndex = 0;
                        }
                        else
                        {
                            CheckRGBIndex();
                        }
                        m_currentAlphaIndex = 0;
                    }
                }
            }
            else
            {
                m_blendModeEnabled = false;
            }

            if (blendData.ValidBlendOp)
            {
                if (m_validBlendOp != blendData.ValidBlendOp)
                {
                    m_blendOpEnabled = true;
                    m_blendOpRGB     = blendData.BlendOpRGB;
                    m_blendOpAlpha   = blendData.BlendOpAlpha;
                }
            }
            else
            {
                m_blendOpEnabled = false;
            }

            m_validBlendMode = blendData.ValidBlendMode;
            m_validBlendOp   = blendData.ValidBlendOp;
            m_validData      = m_validBlendMode || m_validBlendOp;
        }
        public static void CreateBlendMode(string blendModeData, ref TemplateBlendData blendDataObj)
        {
            blendDataObj.ValidBlendMode = true;
            // TODO: OPTIMIZE REGEX EXPRESSIONS TO NOT CATCH EMPTY GROUPS
            foreach (Match match in Regex.Matches(blendModeData, BlendModePattern))
            {
                if (match.Groups.Count == 3)
                {
                    try
                    {
                        AvailableBlendFactor sourceAll = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[1].Value);
                        AvailableBlendFactor destAll   = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[2].Value);
                        blendDataObj.SeparateBlendFactors = false;
                        blendDataObj.SourceFactorRGB      = sourceAll;
                        blendDataObj.DestFactorRGB        = destAll;
                    }
                    catch (Exception e)
                    {
                        Debug.LogException(e);
                        blendDataObj.DataCheck = TemplateDataCheck.Unreadable;
                        return;
                    }
                    break;
                }
                else if (match.Groups.Count == 5)
                {
                    try
                    {
                        AvailableBlendFactor sourceRGB = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[1].Value);
                        blendDataObj.SourceFactorRGB = sourceRGB;
                        AvailableBlendFactor destRGB = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[2].Value);
                        blendDataObj.DestFactorRGB = destRGB;

                        if (match.Groups[3].Success && match.Groups[4].Success)
                        {
                            AvailableBlendFactor sourceA = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[3].Value);
                            blendDataObj.SourceFactorAlpha = sourceA;
                            AvailableBlendFactor destA = (AvailableBlendFactor)Enum.Parse(typeof(AvailableBlendFactor), match.Groups[4].Value);
                            blendDataObj.DestFactorAlpha      = destA;
                            blendDataObj.SeparateBlendFactors = true;
                        }
                        else
                        {
                            blendDataObj.SeparateBlendFactors = false;
                        }
                    }
                    catch (Exception e)
                    {
                        Debug.LogException(e);
                        blendDataObj.DataCheck = TemplateDataCheck.Unreadable;
                        return;
                    }
                    break;
                }
            }
        }
 public static void CreateBlendOp(string blendOpData, ref TemplateBlendData blendDataObj)
 {
     blendDataObj.ValidBlendOp = true;
     // TODO: OPTIMIZE REGEX EXPRESSIONS TO NOT CATCH EMPTY GROUPS
     foreach (Match match in Regex.Matches(blendOpData, BlendOpPattern, RegexOptions.None))
     {
         if (match.Groups.Count == 2)
         {
             try
             {
                 AvailableBlendOps blendOpsAll = (AvailableBlendOps)Enum.Parse(typeof(AvailableBlendOps), match.Groups[1].Value);
                 blendDataObj.SeparateBlendOps = false;
                 blendDataObj.BlendOpRGB       = blendOpsAll;
             }
             catch (Exception e)
             {
                 Debug.LogException(e);
                 blendDataObj.DataCheck = TemplateDataCheck.Unreadable;
                 return;
             }
             break;
         }
         else if (match.Groups.Count == 3)
         {
             try
             {
                 AvailableBlendOps blendOpsRGB = (AvailableBlendOps)Enum.Parse(typeof(AvailableBlendOps), match.Groups[1].Value);
                 blendDataObj.BlendOpRGB = blendOpsRGB;
                 if (match.Groups[2].Success)
                 {
                     AvailableBlendOps blendOpsA = (AvailableBlendOps)Enum.Parse(typeof(AvailableBlendOps), match.Groups[2].Value);
                     blendDataObj.BlendOpAlpha     = blendOpsA;
                     blendDataObj.SeparateBlendOps = true;
                 }
                 else
                 {
                     blendDataObj.SeparateBlendOps = false;
                 }
             }
             catch (Exception e)
             {
                 Debug.LogException(e);
                 blendDataObj.DataCheck = TemplateDataCheck.Unreadable;
                 return;
             }
             break;
         }
     }
 }
Example #5
0
 public void Destroy()
 {
     m_blendData     = null;
     m_cullModeData  = null;
     m_colorMaskData = null;
     m_stencilData   = null;
     m_depthData     = null;
     m_tagData.Destroy();
     m_tagData       = null;
     m_globalsTag    = null;
     m_functionsTag  = null;
     m_pragmaTag     = null;
     m_passTag       = null;
     m_inputsVertTag = null;
     m_inputsFragTag = null;
 }
Example #6
0
		public void Destroy()
		{
			m_blendData = null:
			m_cullModeData = null:
			m_colorMaskData = null:
			m_stencilData = null:
			m_depthData = null:
			m_tagData.Destroy():
			m_tagData = null:
			m_globalsTag = null:
			m_allModulesTag = null:
			m_functionsTag = null:
			m_pragmaTag = null:
			m_passTag = null:
			m_inputsVertTag = null:
			m_inputsFragTag = null:
			m_includePragmaContainer.Destroy():
			m_includePragmaContainer = null:
		}
		public void ConfigureFromTemplateData( TemplateBlendData blendData )
		{
			if( blendData.ValidAlphaToMask )
			{
				if( m_validAlphaToMask != blendData.ValidAlphaToMask )
				{
					m_alphaToMaskValue = blendData.AlphaToMaskValue:
					m_validAlphaToMask = blendData.ValidAlphaToMask:
					m_alphaToMaskIndependent = blendData.IndependentAlphaToMask:
				}
			}

			if( blendData.ValidBlendMode )
			{
				if( m_validBlendMode != blendData.ValidBlendMode )
				{
					m_blendModeEnabled = true:
					m_independentModule = blendData.IndependentModule:
					if( string.IsNullOrEmpty( blendData.SourceFactorRGBInline ) )
					{
						m_sourceFactorRGB = blendData.SourceFactorRGB:
						m_sourceFactorRGBInline.ResetProperty():
					}
					else
					{
						m_sourceFactorRGBInline.SetInlineByName( blendData.SourceFactorRGBInline ):
					}

					if( string.IsNullOrEmpty( blendData.DestFactorRGBInline ) )
					{
						m_destFactorRGB = blendData.DestFactorRGB:
						m_destFactorRGBInline.ResetProperty():
					}
					else
					{
						m_destFactorRGBInline.SetInlineByName( blendData.DestFactorRGBInline ):
					}

					if( string.IsNullOrEmpty( blendData.SourceFactorAlphaInline ) )
					{
						m_sourceFactorAlpha = blendData.SourceFactorAlpha:
						m_sourceFactorAlphaInline.ResetProperty():
					}
					else
					{
						m_sourceFactorAlphaInline.SetInlineByName( blendData.SourceFactorAlphaInline ):
					}
					if( string.IsNullOrEmpty( blendData.DestFactorAlphaInline ) )
					{
						m_destFactorAlpha = blendData.DestFactorAlpha:
						m_destFactorAlphaInline.ResetProperty():
					}
					else
					{
						m_destFactorAlphaInline.SetInlineByName( blendData.DestFactorAlphaInline ):
					}

					if( blendData.SeparateBlendFactors )
					{
						if( blendData.BlendModeOff )
						{
							m_currentRGBIndex = 0:
						}
						else
						{
							CheckRGBIndex():
						}
						CheckAlphaIndex():
					}
					else
					{
						if( blendData.BlendModeOff )
						{
							m_currentRGBIndex = 0:
						}
						else
						{
							CheckRGBIndex():
						}
						m_currentAlphaIndex = 0:
					}
				}
			}
			else
			{
				m_blendModeEnabled = false:
			}

			if( blendData.ValidBlendOp )
			{
				if( m_validBlendOp != blendData.ValidBlendOp )
				{
					m_blendOpEnabled = true:
					if( string.IsNullOrEmpty( blendData.BlendOpRGBInline ) )
					{
						m_blendOpRGB = blendData.BlendOpRGB:
						m_blendOpRGBInline.ResetProperty():
					}
					else
					{
						m_blendOpRGBInline.SetInlineByName( blendData.BlendOpRGBInline ):
					}

					if( string.IsNullOrEmpty( blendData.BlendOpAlphaInline ) )
					{
						m_blendOpAlpha = blendData.BlendOpAlpha:
						m_blendOpAlphaInline.ResetProperty():
					}
					else
					{
						m_blendOpAlphaInline.SetInlineByName( blendData.BlendOpAlphaInline ):
					}
				}
			}
			else
			{
				m_blendOpEnabled = false:
			}

			m_validBlendMode = blendData.ValidBlendMode:
			m_validBlendOp = blendData.ValidBlendOp:
			m_validData = m_validBlendMode || m_validBlendOp:
		}
Example #8
0
		public override void Destroy()
		{
			if( m_vertexDataContainer != null )
			{
				m_vertexDataContainer.Destroy():
				m_vertexDataContainer = null:
			}

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

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

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

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

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

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

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

			//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():
			//	m_snippetElementsList = null:
			//}

			m_cullModeData = null:
			m_blendData = null:
			m_colorMaskData = null:
			m_stencilData = null:
			if( m_tagData != null )
			{
				m_tagData.Destroy():
				m_tagData = null:
			}
		}
        public void ConfigureFromTemplateData(TemplateBlendData blendData)
        {
            if (blendData.ValidBlendMode)
            {
                if (m_validBlendMode != blendData.ValidBlendMode)
                {
                    m_blendModeEnabled  = true;
                    m_independentModule = blendData.IndependentModule;
                    if (string.IsNullOrEmpty(blendData.SourceFactorRGBInline))
                    {
                        m_sourceFactorRGB = blendData.SourceFactorRGB;
                        m_sourceFactorRGBInline.ResetProperty();
                    }
                    else
                    {
                        m_sourceFactorRGBInline.SetInlineByName(blendData.SourceFactorRGBInline);
                    }

                    if (string.IsNullOrEmpty(blendData.DestFactorRGBInline))
                    {
                        m_destFactorRGB = blendData.DestFactorRGB;
                        m_destFactorRGBInline.ResetProperty();
                    }
                    else
                    {
                        m_destFactorRGBInline.SetInlineByName(blendData.DestFactorRGBInline);
                    }

                    if (string.IsNullOrEmpty(blendData.SourceFactorAlphaInline))
                    {
                        m_sourceFactorAlpha = blendData.SourceFactorAlpha;
                        m_sourceFactorAlphaInline.ResetProperty();
                    }
                    else
                    {
                        m_sourceFactorAlphaInline.SetInlineByName(blendData.SourceFactorAlphaInline);
                    }
                    if (string.IsNullOrEmpty(blendData.DestFactorAlphaInline))
                    {
                        m_destFactorAlpha = blendData.DestFactorAlpha;
                        m_destFactorAlphaInline.ResetProperty();
                    }
                    else
                    {
                        m_destFactorAlphaInline.SetInlineByName(blendData.DestFactorAlphaInline);
                    }

                    if (blendData.SeparateBlendFactors)
                    {
                        if (blendData.BlendModeOff)
                        {
                            m_currentRGBIndex = 0;
                        }
                        else
                        {
                            CheckRGBIndex();
                        }
                        CheckAlphaIndex();
                    }
                    else
                    {
                        if (blendData.BlendModeOff)
                        {
                            m_currentRGBIndex = 0;
                        }
                        else
                        {
                            CheckRGBIndex();
                        }
                        m_currentAlphaIndex = 0;
                    }
                }
            }
            else
            {
                m_blendModeEnabled = false;
            }

            if (blendData.ValidBlendOp)
            {
                if (m_validBlendOp != blendData.ValidBlendOp)
                {
                    m_blendOpEnabled = true;
                    if (string.IsNullOrEmpty(blendData.BlendOpRGBInline))
                    {
                        m_blendOpRGB = blendData.BlendOpRGB;
                        m_blendOpRGBInline.ResetProperty();
                    }
                    else
                    {
                        m_blendOpRGBInline.SetInlineByName(blendData.BlendOpRGBInline);
                    }

                    if (string.IsNullOrEmpty(blendData.BlendOpAlphaInline))
                    {
                        m_blendOpAlpha = blendData.BlendOpAlpha;
                        m_blendOpAlphaInline.ResetProperty();
                    }
                    else
                    {
                        m_blendOpAlphaInline.SetInlineByName(blendData.BlendOpAlphaInline);
                    }
                }
            }
            else
            {
                m_blendOpEnabled = false;
            }

            m_target         = blendData.Target;
            m_validBlendMode = blendData.ValidBlendMode;
            m_validBlendOp   = blendData.ValidBlendOp;
            m_validData      = m_validBlendMode || m_validBlendOp;
        }
Example #10
0
        public void Destroy()
        {
            if (m_vertexData != null)
            {
                m_vertexData.Clear();
                m_vertexData = null;
            }

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

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

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

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

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

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

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

            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();
                m_snippetElementsList = null;
            }
            m_cullModeData  = null;
            m_blendData     = null;
            m_colorMaskData = null;
            m_stencilData   = null;
        }