Esempio n. 1
0
 public override void OnAffterAwake()
 {
     base.OnAffterAwake();
     UnitType   = typeof(TUnit);
     ConfigType = typeof(TConfig);
     TDLuaMgr   = BaseLuaMgr.GetTDLuaMgr(ConfigType);
 }
Esempio n. 2
0
 public override void OnBeAdded(IMono mono)
 {
     base.OnBeAdded(mono);
     TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(typeof(TData));
     UnitType = typeof(TData);
     if (IsGlobal)
     {
         BaseGlobal.BattleMgr.Callback_OnBattleLoaded   += OnBattleLoaded;
         BaseGlobal.BattleMgr.Callback_OnBattleUnLoaded += OnBattleUnLoaded;
     }
 }
Esempio n. 3
0
 public override void OnAffterAwake()
 {
     base.OnAffterAwake();
     TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(typeof(TData));
     AllData.Clear();
     foreach (var item in TDLuaMgr.BaseDatas.Values)
     {
         var newData = item.Copy <TData>();
         newData.OnBeAdded(SelfUnit);
         AllData.Add(newData.TDID, newData);
     }
 }
Esempio n. 4
0
 public override void OnBeAdded(IMono mono)
 {
     base.OnBeAdded(mono);
     UnitType   = typeof(TUnit);
     ConfigType = typeof(TConfig);
     TDLuaMgr   = BaseLuaMgr.GetTDLuaMgr(ConfigType);
     if (IsGlobal)
     {
         BaseGlobal.BattleMgr.Callback_OnBattleUnLoaded    += OnBattleUnLoaded;
         BaseGlobal.BattleMgr.Callback_OnBattleLoadedScene += OnBattleLoadedScene;
         BaseGlobal.LoaderMgr.Callback_OnAllLoadEnd2       += OnAllLoadEnd2;
     }
 }
Esempio n. 5
0
 public override void OnAffterAwake()
 {
     base.OnAffterAwake();
     TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(typeof(TData));
     foreach (var item in TDLuaMgr.ObjValues)
     {
         var data = item as TData;
         if (data.Type == AlertType.Continue)
         {
             TDContinueData.Add(data);
         }
     }
 }
Esempio n. 6
0
        protected virtual void OnConvert(WorkSheet sheet, string tableName)
        {
            int excludeRow = StartRowCount;
            var luaMgr     = BaseLuaMgr.GetTDLuaMgr(tableName);

            if (luaMgr != null)
            {
                IEnumerable <object> data;
                if (luaMgr.TableMapper != null)
                {
                    var map = luaMgr.TableMapper.Exclude(excludeRow);
                    map.SafeMode = true;
                    data         = sheet.Convert(map);
                }
                else
                {
                    data = sheet.Convert(luaMgr.DataType, excludeRow, true);
                }
                luaMgr.AddAlterRangeFromObj(data);
            }
        }
Esempio n. 7
0
        void Init(string keyName = null)
        {
            if (keyName == null)
            {
                LuaTableKey = typeof(T).Name;
            }
            else
            {
                LuaTableKey = keyName;
            }

            //去除头部TD前缀和尾部Data后缀
            {
                LuaTableKey = LuaTableKey.TrimStart("TD");
                LuaTableKey = LuaTableKey.TrimEnd("Data");
            }

            NameSpace     = typeof(T).Namespace.ToString();
            AddMethonName = string.Format("Add{0}", LuaTableKey);
            BaseLuaMgr.AddGlobalAction(AddMethonName, Add);
            BaseDataParseMgr.AddTDLuaMgr(this);
        }
Esempio n. 8
0
 public override void OnAffterAwake()
 {
     base.OnAffterAwake();
     TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(typeof(TArticleData));
 }