Exemple #1
0
        /// <summary>
        /// 设置shader的时候,内部会移除之前的shader
        ///可以把shader接口统一为一个
        ///time:当前shader的变化时间
        ///bAutoEnd:自动结束并移除
        /// </summary>
        public void SetShader(eShaderType type, Color color, float time = 9999999, bool bAutoEnd = true, Action end = null)
        {
            UnityEngine.Profiling.Profiler.BeginSample("SetShader");
            GetOriginalColor();


            EntityShaderInfo info;

            info.entity   = this;
            info.type     = type;
            info.color    = color;
            info.bAutoEnd = bAutoEnd;
            info.showTime = time;
            info.curTime  = 0;
            info.showEnd  = end;
            ShaderManager.Inst.AddShader(info);

            UnityEngine.Profiling.Profiler.EndSample();
        }
Exemple #2
0
 public void SetShaderType(eShaderType shader)
 {
     material.shader = Shader.Find(
         shader == eShaderType.Shader_OriginalMode ? Paths.MyCustomShader : Paths.MyCustomShader_NoTransition
         );
 }