示例#1
0
    /// <summary>
    /// 预加载某一类光效
    /// </summary>
    /// <param name="nMapID"></param>
    /// <param name="nType"></param>
    public static void LoadTypePreLight(int nMapID, ASpeedGame.Data.Scheme.LightType nType, CachePriority mask)
    {
        // 加载必须要加载的光效
        ASpeedGame.Data.Scheme.TypeLightNode typeLight = ASpeedGame.Data.Scheme.SchemePreLoadLight.Instance.get(nMapID, nType);
        if (typeLight == null || typeLight.Collection == null || typeLight.Collection.Count == 0)
        {
            return;
        }

        List <Pre_Load_Light_Info> ls = new List <Pre_Load_Light_Info>();

        foreach (var item in typeLight.Collection)
        {
            ASpeedGame.Data.Scheme.ObjectLightNode node = item.Value;

            Pre_Load_Light_Info info = new Pre_Load_Light_Info();
            info.nLightType   = nType;      //光效类型
            info.nMask       |= (int)mask;  //标志位
            info.effectIDList = node.Collection;

            ls.Add(info);
        }

        LightingEffectFactory.Instance.RecvPreLoadLinghtEffectInfo(ls);
    }
示例#2
0
        /// <summary>
        /// 增加某类型下的目标对象数据
        /// </summary>
        /// <param name="nType"></param>
        /// <param name="node"></param>
        public void Add(int nType, ref ObjectLightNode node)
        {
            if (dictTypeLightList.ContainsKey(nType))
            {
                dictTypeLightList[nType].Add(node);
            }
            else
            {
                TypeLightNode current = new TypeLightNode(nType);
                current.Add(node);

                dictTypeLightList.Add(nType, current);
            }
        }