Exemplo n.º 1
0
        /// <summary>
        /// 解析着色器
        /// </summary>
        /// <param name="param">解析参数</param>
        /// <param name="callback">解析完成回调</param>
        public void Analyze(ShaderAnalyzeParams param, AnalyzeFinish callback)
        {
            if (m_CurrentStageType != EAnalyzeStageType.None)
            {
                Debug.LogError("当前正在进行解析,请耐心等待。");
                return;
            }
            if (param.Shader == null)
            {
                Debug.LogError("请指定要解析的着色器。");
                return;
            }
            if (callback == null)
            {
                Debug.LogError("请指定解析完整的回调函数。");
                return;
            }


            m_Params        = param;
            m_AnalyzeFinish = callback;

            m_AnalyzeWrap = new AnalyzeWrap();

            executeNext();

            EditorApplication.update += update;
        }
Exemplo n.º 2
0
 private void Clear()
 {
     EditorUtility.ClearProgressBar();
     EditorApplication.update -= update;
     m_CurrentStageType        = EAnalyzeStageType.None;
     m_CurrentStage            = null;
     m_AnalyzeWrap             = null;
     m_Params        = null;
     m_AnalyzeFinish = null;
     foreach (var item in AnalyzedStageMap)
     {
         foreach (var item1 in item.Value)
         {
             item1.Value.Clear();
         }
     }
 }