예제 #1
0
        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="notifyID"></param>
        /// <param name="_string"></param>
        public static void SendNotify(string notifyID, string _string)
        {
            List <LTEventHandler> findList = null;
            bool isDone = false;

            if (_eventMap.TryGetValue(notifyID, out findList))
            {
                for (int i = 0; i < findList.Count; ++i)
                {
                    _DoAction(findList[i], _string);
                    isDone = true;
                }
            }
            if (!isDone)
            {
                LTDebug.LogWarning("[LTEventLog]{0}事件没有任何响应", notifyID);
            }
        }
예제 #2
0
 public override void DoExport(JsonData jsonData, CSFiled filed, ICell cell)
 {
     if (cell == null)
     {
         jsonData[filed.name] = 0;
     }
     else if (cell.CellType == CellType.String)
     {
         int.TryParse(cell.StringCellValue, out int parseInt);
         jsonData[filed.name] = parseInt;
         LTDebug.LogWarning("int格式,获取到配置表为string:" + cell.StringCellValue + "已自动转为int:" + parseInt);
     }
     else if (cell.CellType == CellType.Numeric)
     {
         jsonData[filed.name] = (int)cell.NumericCellValue;
     }
     else
     {
         LTDebug.LogError("int格式期望类型不匹配,当前为:" + cell.CellType);
         jsonData[filed.name] = 0;
     }
 }
예제 #3
0
        private static void _HandleRegist(string notifyID, LTEventHandler handle)
        {
            List <LTEventHandler> findList = null;

            if (_eventMap.TryGetValue(notifyID, out findList))
            {
                if (findList.Contains(handle))
                {
                    LTDebug.LogWarning("{0}已存在同样事件注册{1},本次注册取消", notifyID, handle);
                }
                else
                {
                    findList.Add(handle);
                }
            }
            else
            {
                findList = new List <LTEventHandler>();
                findList.Add(handle);
                _eventMap.Add(notifyID, findList);
            }
        }