Example #1
0
        /// <summary>
        /// 开始某些表现效果 XML数据类型
        /// </summary>
        /// <param name="nAvatarID">表现效果拥有者server ID,当此目标死亡后对应效果会移除</param>
        /// <param name="nPerformanceLogicID">表现效果逻辑ID</param>
        /// <param name="fTime">当前效果共持续多久</param>
        /// <param name="longID">当前表现效果唯一ID</param>
        /// <param name="values">相关参数</param>
        /// <returns></returns>
        public bool StartPerformanceLogic(int nPerformanceLogicID, ref long longID, int nAvatarID, float fTime, params object[] values)
        {
            if (m_dict == null || !m_dict.ContainsKey(nPerformanceLogicID))
            {
                return(false);
            }

            List <PerformanceLogic> list     = new List <PerformanceLogic>();
            XmlDataList             dataList = m_dict[nPerformanceLogicID];

            foreach (XmlClassData data in dataList)
            {
                PerformanceLogic logic = PerformanceLogicFactory.Instance.GetPerformanceLogic(data.sLogicName);
                if (logic == null)
                {
                    continue;
                }

                logic.SetOwner(nAvatarID);
                if (!logic.InitData(data) || !logic.Init(values))
                {
                    continue;
                }
                logic.SetTotalTime(fTime);
                list.Add(logic);
            }
            longID = GetLogicIndex();
            m_PerformanceLogicDict.Add(longID, list);
            return(true);
        }
Example #2
0
        private static bool IsEqualsAvatar(PerformanceLogic logic, object[] values)
        {
            if (values == null || values.Length < 1)
            {
                return(false);
            }
            int nAvatarID = (int)values[0];

            return(logic.IsBindToAvatar() && logic.GetOwner() == nAvatarID);
        }
Example #3
0
 private static bool IsReleaseWhenChangeScene(PerformanceLogic logic, object[] values)
 {
     return(logic.IsReleaseWhenChangeScene());
 }