Beispiel #1
0
        public void AddPlat()
        {
            if (++_iPlatIndex > BattleManager.GetInst().Stairs)
            {
                return;
            }

            BattleFieldData field = BattleManager.GetInst().GetFieldData(_iPlatIndex);
            BattlePlat      plat  = ResourceMgr.PopBox(SceneId, field.Type);

            plat.Index = _iPlatIndex;
            plat.X     = field.X;
            plat.Y     = field.Y;
            plat.m_Transform.SetParent(ForegroundTran);
            plat.m_Transform.localPosition = new Vector3(field.X, field.Y, 0f);
            plat.m_Transform.localScale    = Vector3.one;
            if (field.Item > 0)
            {
                string itemId = ConfigData.GetValue("Scene_Common", SceneId.ToString(), string.Format("Item{0}", field.Item));
                if (itemId != "-1")
                {
                    int        id   = int.Parse(itemId);
                    BattleItem item = ResourceMgr.PopItem(id);
                    item.Type = id;
                    item.m_Transform.SetParent(plat.m_Transform, false);
                }
            }
            _dicPlat.Add(_iPlatIndex, plat);
        }
Beispiel #2
0
        public void DequeueSkill()
        {
            BattleSkillBtn skill = _queSkill.Dequeue();

            ResourceMgr.PushSkill(skill.Type, skill);
            ResetSkillBar();
        }
Beispiel #3
0
        private void SetMainSkill(int skillId)
        {
            BattleSkillBtn skill = ResourceMgr.PopSkill(skillId);

            skill.IsMainSkill = true;
            skill.m_Transform.SetParent(SkillBarTran);
            skill.SetToLargerScale();
            skill.SetPosImmediately(-4.7f);
        }
Beispiel #4
0
 private void BackToMainScene()
 {
     BattleManager.GetInst().IsBattleRun = false;
     SceneLoaderMain.GetInst().ShowMainScene();
     SceneLoaderMain.GetInst().DestroyBattleUI();
     SceneLoader.UnloadBattleScene();
     SearchingPanel.GetInst().ShowPanel(false);
     ResourceMgr.Clear();
 }
Beispiel #5
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Role"))
     {
         ResourceMgr.PushItem(this);
         BattleHero hero = collision.GetComponent <BattleHero>();
         BattleManager.GetInst().EnqueueSkill(hero.PlayerId, Type);
         CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_GET_ITEM, new ArrayList()
         {
             (byte)Type
         });
     }
 }
Beispiel #6
0
        public void EnqueueSkill(int skillType)
        {
            if (_queSkill.Count > 4)
            {
                DequeueSkill();
            }

            BattleSkillBtn skill = ResourceMgr.PopSkill(skillType);

            skill.m_Transform.SetParent(SkillBarTran);
            skill.SetToOriScale();
            _queSkill.Enqueue(skill);
            ResetSkillBar();
        }
Beispiel #7
0
        public void TapLightning()
        {
            List <CharHandler> lst = m_CharInScene.GetAllMonster();

            if (lst.Count > 0)
            {
                CharHandler monster = lst[Random.Range(0, lst.Count)];
                if (monster.m_CharData.m_eState != BattleEnum.Enum_CharState.PreBorn)
                {
                    ResourceMgr.GetInst().PopTapLightning(monster.m_ParentTrans.position);
                    monster.BeHit(10f, null);
                }
            }
        }
Beispiel #8
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.CompareTag("Role"))
            {
                collision.GetComponent <BattleHero>().ReduceHp(1);
            }
            else
            {
                BattlePlat plat = collision.GetComponent <BattlePlat>();
                if (plat != null)
                {
                    TriggerCbFunc(plat);
                    return;
                }

                BattleItem item = collision.GetComponent <BattleItem>();
                if (item != null)
                {
                    ResourceMgr.PushItem(item);
                    return;
                }
            }
        }
Beispiel #9
0
 public void RemovePlat(BattlePlat plat)
 {
     _dicPlat.Remove(plat.Index);
     ResourceMgr.PushBox(SceneId, plat.Type, plat);
     AddPlat();
 }
Beispiel #10
0
 private void OnDestroy()
 {
     _inst = null;
 }
Beispiel #11
0
 private void Awake()
 {
     _inst = this;
 }