Пример #1
0
    private void CreateMoves()
    {
        BattleData battleData = battle.GetBattleData();

        Dictionary <int, BattleCellData> .Enumerator enumerator2 = battleData.actionDic.GetEnumerator();

        while (enumerator2.MoveNext())
        {
            int pos = enumerator2.Current.Key;

            BattleCellData cellData = enumerator2.Current.Value;

            for (int i = 0; i < cellData.attackers.Count; i++)
            {
                GameObject go = CreateArrow(cellData.attackers[i].pos, pos, Color.red, i);

                arrowList.Add(go);
            }

            for (int i = 0; i < cellData.supporters.Count; i++)
            {
                GameObject go = CreateArrow(cellData.supporters[i].pos, pos, Color.green, i);

                arrowList.Add(go);
            }

            for (int i = 0; i < cellData.shooters.Count; i++)
            {
                GameObject go = CreateShootArrow(cellData.shooters[i].pos, pos, Color.yellow);

                arrowList.Add(go);
            }
        }
    }
Пример #2
0
        void CollisionDetection(List <BattleCellData> battleCellDataList)
        {
            BattleCellData walkFrontestCellData = battleCellDataList.Find(c => c.state == eBattleCellState.Walk);

            if (walkFrontestCellData != null && walkFrontestCellData.modelTrans != null)
            {
                float distance = (walkFrontestCellData.modelTrans.position - mDMono.transform.position).sqrMagnitude;
                if (distance < collisionDistance)
                {
                    mDMono.enabled = false;
                }
            }
        }
Пример #3
0
 public void SetData(BattleCellData data, float speed, List <NationBattleHudController.TargetPosEntry> npl, float dis, Transform shadow, Vector3 shadowOffset)
 {
     posIndex          = 0;
     cellData          = data;
     moveSpeed         = speed;
     nextPosList       = npl;
     shadow_t          = shadow;
     this.shadowOffset = shadowOffset;
     collisionDistance = dis;
     if (nextPosList.Count > 0)
     {
         moveDir = nextPosList[posIndex].dir;
     }
     else
     {
         mDMono.enabled = false;
         mDMono.gameObject.CustomSetActive(false);
         shadow_t.gameObject.CustomSetActive(false);
     }
 }
Пример #4
0
    private void Initialize()
    {
        m_bIsInit = true;
        var _flag      = 0;
        var _cellCount = 0;
        var _list      = new List <BattleCellData>();

        Table.ForeachPVPBattle((record =>
        {
            var _cell = new BattleCellData();
            _cell.Id = record.Id;
            _cell.IsSelect = false;
            _cell.Index = _flag;
            _flag++;
            _list.Add(_cell);
            // var dungeondId = record.Fuben[0];
            //if (dungeondId != -1)
            //{
            //    var tbDungeon = Table.GetFuben(dungeondId);
            //    if (tbDungeon != null)
            //    {
            //        cell.FlagReceive = tbDungeon.FlagId;
            //        bool recive = PlayerDataManager.Instance.GetFlag(cell.FlagReceive);
            //        if (!recive)
            //        {
            //            cell.ShowNotice = true;
            //        }
            //        else
            //        {
            //            cell.ShowNotice = false;
            //        }
            //    }
            //}
            return(true);
        }));
        m_DataModel.BattleCells = new ObservableCollection <BattleCellData>(_list);
    }