Ejemplo n.º 1
0
 public override void OnBeAdded(IMono mono)
 {
     base.OnBeAdded(mono);
     AssianModel();
     if (Model == null)
     {
         CLog.Error("Unit 没有model");
         return;
     }
     ModelRenders = Model.GetComponentsInChildren <Renderer>();
     {
     }
     SkinnedMeshRenderers = Model.GetComponentsInChildren <SkinnedMeshRenderer>();
     {
         float lastSize = 0.0f;
         float curSize  = 0.0f;
         foreach (var item in SkinnedMeshRenderers)
         {
             Vector3 extents = item.bounds.extents;
             curSize = extents.x + extents.y + extents.z;
             if (curSize > lastSize)
             {
                 lastSize        = curSize;
                 MainSkinnedMesh = item;
             }
         }
     }
     IsEnableRenders = true;
     if (IsUseSurfaceMaterial)
     {
         SurfSource.InitByMgr(this);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加平台SDK组建
        /// </summary>
        protected void AddPlatformSDKComponet()
        {
            var type = VersionMgr.Config.Distribution;

            if (type == Distribution.Steam)
            {
                AddSteamSDKMgr();
            }
            else if (type == Distribution.Rail)
            {
                AddRailSDKMgr();
            }
            else if (type == Distribution.Turbo)
            {
                AddTurboSDKMgr();
            }
            else if (type == Distribution.Trial)
            {
                AddTrialSDKMgr();
            }
            else if (type == Distribution.Gaopp)
            {
                AddGaoppSDKMgr();
            }
            else
            {
                CLog.Error("未知SDK:" + type.ToString());
            }
        }
Ejemplo n.º 3
0
        public T this[string name]
        {
            get
            {
                if (!ContainsKey(name))
                {
                    T temp = null;
                    if (pathType == AssetsPathType.Resources)
                    {
                        temp = Resources.Load(path + "/" + name, typeof(T)) as T;
                    }
                    else if (pathType == AssetsPathType.AssetBundle)
                    {
                        CLog.Error("因为是bundle资源,请先通过Add函数加载资源");
                        return(null);
                    }

                    if (temp)
                    {
                        Add(name, temp);
                    }
                    else
                    {
                        CLog.Error(Path + name);
                        return(null);
                    }
                }
                return(data[name]);
            }
        }
Ejemplo n.º 4
0
        // Config对象只能使用属性来映射
        // DBData对象可以使用属性或者字段来映射
        public static void CopyToTD <TData, TConfig>(TData data, TConfig config)
        {
            if (config == null || data == null)
            {
                return;
            }
            var cType = config.GetType();
            var dType = data.GetType();
            var flag  = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;

            //设置属性
            foreach (var dAttr in dType.GetMembers(flag))
            {
                var cAttr = cType.GetProperty(dAttr.Name, flag);
                if (cAttr != null)
                {
                    if (cAttr.GetReturnType().Name != dAttr.GetReturnType().Name)
                    {
                        CLog.Error("CopyToTD错误!名称相同但是类型不同,{0},{1}--{2}", dAttr.Name, data.ToString(), config.ToString());
                        continue;
                    }
                    cAttr.SetValue(config, dAttr.GetMemberValue(data));
                }
            }
        }
Ejemplo n.º 5
0
 void RefreshData()
 {
     titleContent.text     = "Build";
     TitleStyle.fixedWidth = 100;
     EnsureProjectFiles();
     RefreshSceneNames();
     Repaint();
     if (DLCConfig.Ins != null &&
         BuildConfig.Ins != null &&
         LocalConfig.Ins != null &&
         GameConfig.Ins != null &&
         CursorConfig.Ins != null &&
         UIConfig.Ins != null &&
         ImportConfig.Ins != null &&
         LogConfig.Ins != null
         )
     {
         CLog.Info("创建所有的Config成功!!!");
     }
     else
     {
         CLog.Error("有Config没有创建成功");
     }
     CLog.Info("打开开发者界面");
 }
Ejemplo n.º 6
0
 //推送谈判内容到Alert,用于给对方发送信息
 public void PushNagotiationToAlert(TDBaseAlertData data)
 {
     if (!IsStarNegotiation)
     {
         CLog.Error("AddArticle 没有调用StarNegotiation");
         return;
     }
     data.SelfArticle.Clear();
     data.TargetArticle.Clear();
     foreach (var item in TempSelfArticlies)
     {
         item.ID         = IDUtil.Gen();
         item.BaseTarget = TargetArticleUnit;
         item.OnBeAdded(SelfArticleUnit);
         Datas.Add(item);
         data.SelfArticle.Add(item);
     }
     foreach (var item in TempTargetArticlies)
     {
         item.ID         = IDUtil.Gen();
         item.BaseTarget = SelfArticleUnit;
         item.OnBeAdded(TargetArticleUnit);
         Datas.Add(item);
         data.TargetArticle.Add(item);
     }
     data.WarfareData = CurWarData;
     clearNagotiation();
 }
Ejemplo n.º 7
0
 public override void RefreshAchievements()
 {
     foreach (var item in SteamUserStats.Achievements)
     {
         if (Achievements.ContainsKey(item.Identifier))
         {
         }
         else
         {
             var tempData = GetAchieveData.Copy <TDBaseAchieveData>();
             {
                 tempData.State      = item.State;
                 tempData.UnlockTime = item.UnlockTime.Value;
                 tempData.SourceName = item.Name;
                 tempData.SourceDesc = item.Description;
             };
             if (tempData == null)
             {
                 CLog.Error("没有配置这个成就:{0}", item.Identifier);
                 continue;
             }
             Achievements.Add(item.Identifier, tempData);
         }
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 加载游戏
        /// </summary>
        public virtual void LoadGame(string dbKey)
        {
            if (IsInBattle)
            {
                ReloadGame(dbKey);
                return;
            }

            BaseDBGameData data = SelfBaseGlobal.DBMgr.LoadGame(dbKey);

            if (data == null)
            {
                CLog.Error("游戏存档为空");
                return;
            }

            TDBaseBattleData tempData = Table.Find(data.BattleID);

            if (tempData == null)
            {
                CLog.Error("没有这个战场:{0}", data.BattleID);
                return;
            }
            data.GamePlayStateType = GamePlayStateType.LoadGame;
            LoadBattle(tempData);
        }
Ejemplo n.º 9
0
 public virtual TalkFragment Start(string id, int index = 0)
 {
     CurData = Table.Find(id);
     if (CurData == null)
     {
         CLog.Error("没有找到对话:{0}", id);
         return(null);
     }
     CurTalkIndex         = index;
     CurSelectOption      = BaseConstMgr.STR_Inv;
     CurSelectOptionIndex = -1;
     if (IsHave())
     {
         var ret = CurData.Fragments[CurTalkIndex];
         Callback_OnStartTalk?.Invoke(CurData, ret);
         Callback_OnTalk?.Invoke(CurData, ret, CurTalkIndex);
         OnTalk(CurData, ret, CurTalkIndex);
         OnStartTalk(CurData, ret);
         IsStartTalk = true;
         if (!PauseFlag)
         {
             SelfBaseGlobal.PlotMgr.EnablePlotMode(true);
         }
         PauseFlag = true;
         return(ret);
     }
     return(null);
 }
Ejemplo n.º 10
0
 private T GetResWithCache <T>(string bundle, string name, ObjectRegister <T> cache, bool logError = true) where T : UnityEngine.Object
 {
     if (name.IsInvStr())
     {
         return(null);
     }
     if (cache.ContainsKey(name))
     {
         return(cache[name]);
     }
     else
     {
         DLCAssetMgr.IsNextLogError = logError;
         T retGO = SelfBaseGlobal.DLCMgr.LoadAsset <T>(bundle, name);
         if (retGO == null)
         {
             if (logError)
             {
                 CLog.Error("no this res in bundle {0}, name = {1}", bundle, name);
             }
         }
         else
         {
             cache.Add(retGO);
         }
         return(retGO);
     }
 }
Ejemplo n.º 11
0
 // 从运行中的游戏保存
 public ArchiveFile <T> SaveData(string id, T GameData, bool isAsyn = true, bool isDirtyList = true, bool isHide = false)
 {
     if (isAsyn && isDirtyList)
     {
         CLog.Error("错误!isAsyn && isDirtyList 不能同时出现");
     }
     ArchiveFile <T> archive = new ArchiveFile <T>(id, CurArchiveVersion, default, isHide);
Ejemplo n.º 12
0
        //创建一个全局的HUDitem
        public static THUD Spawn <THUD>(string prefabName, BaseUnit followUnit = null) where THUD : UHUDBar
        {
            if (prefabName.IsInv())
            {
                return(null);
            }
            GameObject tempGO = BaseGlobal.GRMgr.UI.Get(prefabName);

            if (tempGO != null)
            {
                var temp = CommonHUDView.Jump(tempGO, followUnit);
                if (temp == null)
                {
                    CLog.Error("错误!Spawn HUD,没有添加HUDitem组件:" + prefabName);
                    return(null);
                }
                temp.SetFollowObj(GetNode(followUnit, temp.NodeType));
                return(temp as THUD);
            }
            else
            {
                CLog.Error("错误!Spawn:" + prefabName);
            }
            return(null);
        }
Ejemplo n.º 13
0
 public virtual TDBaseTalkFragment Start(string id, int index = 0)
 {
     CurData = TDLuaMgr.Get <TData>(id);
     if (CurData == null)
     {
         CLog.Error("没有找到对话:{0}", id);
         return(null);
     }
     CurTalkIndex         = index;
     CurSelectOption      = Const.STR_Inv;
     CurSelectOptionIndex = -1;
     if (IsHave())
     {
         var ret = CurData.Fragments[CurTalkIndex];
         Callback_OnStart?.Invoke(CurData, ret);
         Callback_OnTalk?.Invoke(CurData, ret, CurTalkIndex);
         OnTalk(CurData, ret, CurTalkIndex);
         OnStartTalk(CurData, ret);
         IsStartTalk = true;
         if (!PauseFlag)
         {
             PlotMgr.SetPlotPause(true);
         }
         PauseFlag = true;
         return(ret);
     }
     return(null);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 添加语言
 /// </summary>
 /// <param name="type"></param>
 /// <param name="key"></param>
 /// <param name="desc"></param>
 public virtual void Add(LanguageType type, string key, string desc, string fileName = "")
 {
     if (key.StartsWith(BaseConstMgr.Prefix_Notes))
     {
         return;
     }
     if (key.IsInvStr() || desc.IsInvStr())
     {
         return;
     }
     if (!lanKeys.Contains(key))
     {
         lanKeys.Add(key);
     }
     if (!data.ContainsKey(type))
     {
         data.Add(type, new Dictionary <string, string>());
     }
     if (!data[type].ContainsKey(key))
     {
         data[type].Add(key, desc);
     }
     else
     {
         if (Application.isEditor)
         {
             CLog.Error("错误!重复的组建key:" + key + " 当前语言:" + type.ToString() + "  file Name:" + fileName);
         }
         data[type][key] = desc;
     }
 }
Ejemplo n.º 15
0
        public virtual void Load(string battleID = "")
        {
            if (IsInBattle)
            {
                CLog.Error("正处于SubBattle中");
                return;
            }
            TDBaseBattleData tempData = TDLuaMgr.Get <TData>(battleID);

            if (tempData == null)
            {
                CLog.Error("没有这个战场:{0}", battleID);
                return;
            }
            SubBattleCoroutine.Kill();
            CurData = tempData.Copy <TData>();
            if (CurData != null)
            {
                BattleID = tempData.TDID;
                CurData.OnBeAdded(SelfBaseGlobal);
                BattleCoroutine.Run(_LoadBattle());
            }
            else
            {
                CLog.Error("Battle not found !error id=" + battleID);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 加载新游戏
        /// </summary>
        public virtual void StartNewGame(string battleId = "")
        {
            if (IsInBattle)
            {
                CLog.Error("正在游戏中");
                return;
            }

            TDBaseBattleData tempData = Table.Find(battleId);

            if (tempData == null)
            {
                CLog.Error("没有这个战场:{0}", battleId);
                return;
            }

            BaseDBGameData data = SelfBaseGlobal.DBMgr.StartNewGame();

            if (data == null)
            {
                CLog.Error("游戏存档为空");
                return;
            }
            data.GameNetMode       = GameNetMode.PVE;
            data.GamePlayStateType = GamePlayStateType.NewGame;
            LoadBattle(tempData);
            Callback_OnStartNewGame?.Invoke();
        }
Ejemplo n.º 17
0
        // 加载新游戏
        public virtual void StartNewGame(string battleId = "")
        {
            if (SubBattleMgr != null && SubBattleMgr.IsInBattle)
            {
                CLog.Error("正在SubBattle中");
                return;
            }
            if (IsInBattle)
            {
                CLog.Error("正在游戏中");
                return;
            }

            TDBaseBattleData tempData = TDLuaMgr.Get <TData>(battleId);

            if (tempData == null)
            {
                CLog.Error("没有这个战场:{0}", battleId);
                return;
            }

            BattleID = battleId;
            DBBaseGame data = DBMgr.StartNewGame();

            if (data == null)
            {
                CLog.Error("游戏存档为空");
                return;
            }
            data.GameNetMode       = GameNetMode.PVE;
            data.GamePlayStateType = GamePlayStateType.NewGame;
            LoadScene(tempData);
            Callback_OnStartNewGame?.Invoke();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 读取文件中的APPid
        /// </summary>
        /// <returns></returns>
        private uint ReadFileAppId()
        {
            if (LocalAppIDFilePath().IsInvStr())
            {
                return(0);
            }
            uint   r  = 0;
            string id = null;

            try
            {
                id = File.ReadAllText(LocalAppIDFilePath());
            }
            catch (Exception e)
            {
                CLog.Error("无法打开appid文件, {0}", e);
                return(0);
            }

            if (!uint.TryParse(id, out r))
            {
                CLog.Error("无法读取AppID {0}", id);
                return(0);
            }
            else
            {
                return(r);
            }
        }
Ejemplo n.º 19
0
        // 加载游戏
        public virtual void LoadGame(string dbKey)
        {
            if (SubBattleMgr != null && SubBattleMgr.IsInBattle)
            {
                CLog.Error("正在SubBattle中");
                return;
            }
            if (IsInBattle)
            {
                ReloadGame(dbKey);
                return;
            }

            DBBaseGame data = DBMgr.LoadGame(dbKey);

            if (data == null)
            {
                CLog.Error("游戏存档为空");
                return;
            }

            TDBaseBattleData tempData = TDLuaMgr.Get <TData>(data.BattleID);

            if (tempData == null)
            {
                CLog.Error("没有这个战场:{0}", data.BattleID);
                return;
            }
            data.GamePlayStateType = GamePlayStateType.LoadGame;
            LoadScene(tempData);
        }
Ejemplo n.º 20
0
 public void CalcNodes()
 {
     Nodes.Clear();
     NodeObjs = GetComponentsInChildren <Transform>();
     if (NodeObjs != null)
     {
         foreach (var item in NodeObjs)
         {
             if (item == transform)
             {
                 transform.localPosition = Vector3.zero;
                 continue;
             }
             GraphNode node = null;
             if (Application.isPlaying)
             {
                 node = AStarMgr.GetSafeNode(item.position);
             }
             else
             {
                 node = AstarPath.GetNearest(item.position).node;
             }
             if (node == null)
             {
                 CLog.Error("错误! 没有Node");
                 continue;
             }
             Nodes.Add(node);
             item.position = (Vector3)node.position;
             item.name     = "Item";
         }
     }
 }
Ejemplo n.º 21
0
        public override void OnAllLoadEnd2()
        {
            base.OnAllLoadEnd2();
            //添加到全局属性表
            Type   type                = typeof(T);
            string enumName            = type.Name;
            List <TDBaseAttrData> data = new List <TDBaseAttrData>();
            Dictionary <string, TDBaseAttrData> dataDic = new Dictionary <string, TDBaseAttrData>();
            HashList <string> dataCategory = new HashList <string>();

            string[] names = Enum.GetNames(type);
            foreach (var item in names)
            {
                var val = Get(item);
                if (val == null || val.TDID.IsInv())
                {
                    CLog.Error("没有这个属性:{0}", item);
                    continue;
                }
                val.EnumName = enumName;
                data.Add(val);
                dataDic.Add(item, val);
                dataCategory.Add(val.Category);
            }
            AttrDataList.Add(type, data);
            AttrDataDic.Add(type, dataDic);
            AttrCategories.Add(type, dataCategory);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 获得额外的加成
        /// </summary>
        protected float GetExtraAddtion(AttrConvertData <T> data, float?customVal = null)
        {
            if (data == null)
            {
                return(0);
            }
            int fromIndex = BoxAvoidance <T> .ToInt(data.From);

            TDAttrData tempData = attrDataList[fromIndex];
            var        fromVal  = _curDataPool[fromIndex];

            if (customVal.HasValue)
            {
                fromVal = customVal.Value;
            }
            var toVal = 0.0f;
            var Step  = data.Step;

            if (Step == 0)
            {
                CLog.Error("Step不能为0");
                return(0.0f);
            }

            if (!data.IsReverse)
            {
                toVal = (fromVal / Step) * data.Faction;
            }
            else
            {
                toVal = ((tempData.Max - fromVal) / Step) * data.Faction;
            }
            return(Mathf.Clamp(toVal, data.Min, data.Max));
        }
Ejemplo n.º 23
0
 void Play()
 {
     if (BaseGlobal == null)
     {
         return;
     }
     if (Clips == null)
     {
         CLog.Error("BaseAudioPlay没有配置音频文件:{0}", name);
     }
     if (!Is2D)
     {
         AudioSource = BaseGlobal.AudioMgr.PlaySFX(
             RandUtil.RandArray(Clips),
             Pos,
             IsLoop,
             IsCache,
             IsForce,
             Volume * BaseGlobal.AudioMgr.GetRealVolumeSFX());
     }
     else
     {
         AudioSource = BaseGlobal.AudioMgr.PlayUI(RandUtil.RandArray(Clips), IsLoop);
     }
 }
Ejemplo n.º 24
0
        protected virtual void AddAttrVal(T type, float val)
        {
            var index = BoxAvoidance <T> .ToInt(type);

            if (attrDataList != null)
            {
                TDAttrData tempAttrData = null;
                if (index >= attrDataList.Count)
                {
                    CLog.Error("SetAttrVal:" + type.ToString() + ":没有配置属性表");
                    return;
                }
                tempAttrData = attrDataList[index];
                if (tempAttrData == null)
                {
                    _curDataPool[index] += val;
                }
                else
                {
                    _curDataPool[index] += val;
                    _curDataPool[index]  = Mathf.Clamp(_curDataPool[index], tempAttrData.Min, tempAttrData.Max);
                }
            }
            else
            {
                _curDataPool[index] += val;
            }
        }
Ejemplo n.º 25
0
        public virtual void InitAttr(T type, float val)
        {
            var index = BoxAvoidance <T> .ToInt(type);

            if (attrDataList != null)
            {
                TDAttrData tempAttrData = null;
                if (index >= attrDataList.Count)
                {
                    CLog.Error("InitAttr:" + type.ToString() + ":没有配置属性表");
                    return;
                }
                tempAttrData = attrDataList[index];
                if (tempAttrData == null)
                {
                    _curDataPool[index]  = val;
                    _baseDataPool[index] = val;
                }
                else
                {
                    _curDataPool[index]  = Mathf.Clamp(val, tempAttrData.Min, tempAttrData.Max);
                    _baseDataPool[index] = Mathf.Clamp(val, tempAttrData.Min, tempAttrData.Max);
                }
            }
            else
            {
                _curDataPool[index]  = val;
                _baseDataPool[index] = val;
            }
            SetDirty();
        }
Ejemplo n.º 26
0
        //开始
        void StartTurn(bool isForce = false)
        {
            if (IsPause && !isForce)
            {
                return;
            }
            _isInEndTurnFlag = false;
            BattleCoroutine.Kill(OnInEndTurnCoroutine);
            BattleCoroutine.Kill(OnInPostEndTurnCoroutine);
            //新的一回合开始
            if (CurTurnIndex == 0)
            {
                AllUnits = CalcAllUnits().OrderByDescending(x => x.IsPlayerCtrl()).ToList();
                OnTurnAllStart();
            }
            if (AllUnits.Count <= 0)
            {
                CLog.Error("AllUnits人数太少");
                return;
            }
            var unit = AllUnits[CurTurnIndex];

            CurOperatingUnit = unit;
            OnSetMustProcess(unit);
            Callback_OnStartTurn?.Invoke(unit, isForce);
            OnTurnStart(unit, isForce);
            if (unit.IsPlayer())
            {
                OnTurnPlayerStart();
                Callback_OnStartPlayerTurn?.Invoke();
            }
        }
Ejemplo n.º 27
0
 //结束当前回合
 public bool EndTurn(T endUnit = null)
 {
     if (IsPause || IsInEndTurn)
     {
         return(false);
     }
     if (SubBattleMgr.IsInBattle)
     {
         CLog.Error("错误!试图在SubBattle阶段结束回合");
         return(false);
     }
     if (endUnit == null)
     {
         endUnit = Player as T;
     }
     OnPreEndTurn(endUnit);
     if (!IsCanEndTurn(endUnit))
     {
         OnCantEndTurn(endUnit);
         return(false);
     }
     _isInEndTurnFlag = true;
     BattleCoroutine.Kill(OnInEndTurnCoroutine);
     OnInEndTurnCoroutine = BattleCoroutine.Run(OnInEndTurn(endUnit));
     return(true);
 }
Ejemplo n.º 28
0
        public override void OnBeAdded(IMono mono)
        {
            base.OnBeAdded(mono);
            string     fullpath = Const.Path_Settings;
            TDBSetting settings = default;

            if (File.Exists(fullpath))
            {
                using (Stream stream = File.OpenRead(fullpath))
                {
                    if (stream != null)
                    {
                        try
                        {
                            settings = FileUtil.LoadJson <TDBSetting>(stream);
                        }
                        catch (Exception e)
                        {
                            settings = default;
                            CLog.Error("载入settings出错{0}", e);
                        }
                    }
                }
            }
            if (settings == null)
            {
                IsFirstCreateSettings = true;
                settings = new TDBSetting();
                Save();
            }
            SetSettings(settings);
        }
Ejemplo n.º 29
0
 public void RemoveArticle(ArticleObjType target, TArticleData data)
 {
     if (!IsStarNegotiation)
     {
         CLog.Error("AddArticle 没有调用StarNegotiation");
         return;
     }
     if (data == null)
     {
         return;
     }
     if (target == ArticleObjType.Self)
     {
         TempSelfArticlies.Remove(data);
         BaseTempSelfArticlies.Remove(data);
         TempSelfArticlies     = TempSelfArticlies.OrderBy((x) => x.TDID).ToList();
         BaseTempSelfArticlies = BaseTempSelfArticlies.OrderBy((x) => x.TDID).ToList();
     }
     if (target == ArticleObjType.Target)
     {
         TempTargetArticlies.Remove(data);
         BaseTempTargetArticlies.Remove(data);
         TempTargetArticlies     = TempTargetArticlies.OrderBy((x) => x.TDID).ToList();
         BaseTempTargetArticlies = BaseTempTargetArticlies.OrderBy((x) => x.TDID).ToList();
     }
     if (BaseGlobal.IsUnReadData)
     {
         Callback_OnRemoveArticle?.Invoke(data);
     }
 }
Ejemplo n.º 30
0
        public void AddArticle(string articleID, ArticleObjType targetType, Callback <TArticleData> action)
        {
            if (!IsStarNegotiation)
            {
                CLog.Error("AddArticle 没有调用StarNegotiation");
                return;
            }
            TArticleData data = TDLuaMgr.Get <TArticleData>(articleID);

            if (data == null)
            {
                return;
            }
            if (!IsCanAddArticle(targetType, data))
            {
                return;
            }
            var newData = data.Copy <TArticleData>();

            action?.Invoke(newData);
            if (IsRepeate(targetType, newData))
            {
                return;
            }

            if (targetType == ArticleObjType.Self)
            {
                newData.ArticleObjType = targetType;
                newData.SetSelfBaseUnit(SelfArticleUnit);
                newData.BaseTarget = TargetArticleUnit;
                TempSelfArticlies.Add(newData);
                BaseTempSelfArticlies.Add(newData);
                if (newData.IsMutex)
                {
                    RemoveArticle(ArticleObjType.Target, TempTargetArticlies.FindLast(x => x.TDID == articleID));
                }
                TempSelfArticlies     = TempSelfArticlies.OrderBy((x) => x.TDID).ToList();
                BaseTempSelfArticlies = BaseTempSelfArticlies.OrderBy((x) => x.TDID).ToList();
            }
            else if (targetType == ArticleObjType.Target)
            {
                newData.ArticleObjType = targetType;
                newData.SetSelfBaseUnit(TargetArticleUnit);
                newData.BaseTarget = SelfArticleUnit;
                TempTargetArticlies.Add(newData);
                BaseTempTargetArticlies.Add(newData);
                if (newData.IsMutex)
                {
                    RemoveArticle(ArticleObjType.Self, TempSelfArticlies.FindLast(x => x.TDID == articleID));
                }
                TempTargetArticlies     = TempTargetArticlies.OrderBy((x) => x.TDID).ToList();
                BaseTempTargetArticlies = BaseTempTargetArticlies.OrderBy((x) => x.TDID).ToList();
            }
            if (BaseGlobal.IsUnReadData)
            {
                Callback_OnAddArticle?.Invoke(newData);
            }
            return;
        }