예제 #1
0
        /// <summary>
        /// 分发网格,分发到对应的glow、DissloveGlow、GlowOutLine中
        /// </summary>
        public static EffectDispatchResult DispatchMesh(Mesh m, Matrix4x4 matrix, Material mat, int layer = -1)
        {
            if (!mat)
            {
                return(EffectDispatchResult.Dispatch_None);
            }

            if (layer != -1)
            {
                if (layer != LayerMask.NameToLayer(Config.LayerLightingEffectOnly))
                {
                    return(EffectDispatchResult.Dispatch_None);
                }
            }

            if (!EffectUtily.DispatchMeshToGlow(m, matrix, mat))
            {
                if (!EffectUtily.DispatchMeshToDissolveGlow(m, matrix, mat))
                {
                    if (EffectUtily.DispatchMeshToGlowOutLine(m, matrix, mat))
                    {
                        return(EffectDispatchResult.Dispatch_GlowOutLine);
                    }
                    return(EffectDispatchResult.Dispatch_None);
                }
                return(EffectDispatchResult.Dispatch_DissloveGlow);
            }
            return(EffectDispatchResult.Diapatch_Glow);
        }