Example #1
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);
            }
        }
Example #2
0
 /// <summary>
 /// 加载战斗场景
 /// </summary>
 protected void LoadBattle(TDBaseBattleData data, bool readData = true)
 {
     GC.Collect();
     MainUICoroutine.Kill();
     CurData = data.Copy() as TData;
     if (CurData != null)
     {
         CurData.OnBeAdded(SelfBaseGlobal);
         BattleCoroutine.Run(_LoadBattle(readData));
     }
     else
     {
         CLog.Error("Battle not found !error id=" + data.TDID);
     }
 }
Example #3
0
        /// <summary>
        /// 改变行为树
        /// </summary>
        public override void ChangeBT(string btKey)
        {
            if (btKey.IsInvStr())
            {
                return;
            }
            RemoveBT();
            TData tempData = Table.Find(btKey);

            if (tempData != null)
            {
                CurData = tempData.Copy() as TData;
                CurData.OnBeAdded(SelfBaseUnit);
            }
            else
            {
                CLog.Error("错误,没有这个类型的BT:{0}", btKey);
            }
        }
Example #4
0
 // 加载场景
 protected void LoadScene(TDBaseBattleData data, bool readData = true)
 {
     if (data == null)
     {
         return;
     }
     MainUICoroutine.Kill();
     CurData = data.Copy <TData>();
     if (CurData != null)
     {
         BattleID = data.TDID;
         CurData.OnBeAdded(SelfBaseGlobal);
         BattleCoroutine.Run(_loadBattle(readData));
     }
     else
     {
         CLog.Error("Battle not found !error id=" + data.TDID);
     }
 }
Example #5
0
        /// <summary>
        /// 改变行为树
        /// </summary>
        public virtual void Change(string smKey)
        {
            if (smKey.IsInv())
            {
                return;
            }
            Remove();
            TData tempData = TDLuaMgr.Get <TData>(smKey);

            if (tempData != null)
            {
                CurData = tempData.Copy <TData>();
                CurData.OnBeAdded(SelfBaseUnit);
            }
            else
            {
                CLog.Error("错误,没有这个类型的AI:{0}", smKey);
            }
        }
Example #6
0
        /// <summary>
        /// 开始一段剧情
        /// </summary>
        public virtual void Start(string id)
        {
            if (id.IsInvStr())
            {
                return;
            }
            var temp = Table.Find(id);

            if (temp == null)
            {
                CLog.Error("无法找到剧情:{0}", id);
                return;
            }
            else
            {
                CurData = temp.Copy() as TData;
            }
            CurPlotIndex = 0;
            CurData.OnBeAdded(SelfBaseGlobal);
            BattleCoroutine.Run(CurData.OnPlotStart());
        }