Exemple #1
0
        private void CreateCharOfficial(BattleEnum.Enum_CharSide side, int charId, int charIndex)
        {
            CharHandler h = BattleScenePool.GetInst().LoadHero(side, charId, charIndex);

            h.m_CharData.SetCharType(BattleEnum.Enum_CharType.Official);
            SetObstacleAvoidance(h);
            h.m_CharSkill.InitTriggerSkill();
            SetRingLight(h);
            BattleManager.GetInst().m_CharInScene.AddChar(h);
        }
Exemple #2
0
        private void SetEffect(SkillDataSon skillDataSon, Vector3 pos)
        {
            string recepEffectPath = skillDataSon.m_Parent.m_sBulletPath;

            if (!recepEffectPath.Equals(string.Empty))
            {
                Transform effectTrans = BattleScenePool.GetInst().PopEffect(recepEffectPath);
                effectTrans.position = pos;
                BattleScenePool.GetInst().PushEffect(recepEffectPath, effectTrans, 5);
            }
        }
        public static CharHandler CreateMonster(BattleEnum.Enum_CharSide side, int charId, int charIndex, Vector3 pos, Quaternion rot, int index)
        {
            CharHandler h = BattleScenePool.GetInst().PopMonsterHandler(charId);

            SetMonsterData(h);
            SetObstacleAvoidanceMonster(h);
            SetRadius(h);
            h.ToBorn(0.3f * (index + 1));
            ResetPosition(h, pos, rot);
            BattleManager.GetInst().m_CharInScene.AddChar(h);
            return(h);
        }
Exemple #4
0
        private void SetEffect(SkillDataSon skillDataSon, Vector3 pos)
        {
            if (null == skillDataSon)
            {
                return;
            }

            string recepEffectPath = skillDataSon.m_ReceptorEffect[0];

            if (!recepEffectPath.Equals(string.Empty))
            {
                Transform effectTrans = BattleScenePool.GetInst().PopEffect(recepEffectPath);
                effectTrans.position = pos;
                BattleScenePool.GetInst().PushEffect(recepEffectPath, effectTrans, 1);
            }
        }
        public static CharHandler CreateBoss(BattleEnum.Enum_CharSide side, int charId, int charIndex, Vector3 pos, Quaternion rot)
        {
            CharHandler h  = BattleScenePool.GetInst().LoadHero(side, charId, charIndex);
            Rigidbody   rb = h.m_Go.AddComponent <Rigidbody>();
            BoxCollider cl = h.m_Go.AddComponent <BoxCollider>();

            rb.useGravity = false;
            cl.isTrigger  = true;
            h.m_CharData.SetCharType(BattleEnum.Enum_CharType.General);
            SetObstacleAvoidanceBoss(h);
            SetRadius(h);
            h.m_CharSkill.InitTriggerSkill();
            SetApplyRootMotionBoss(h);
            SetRingLightBoss(h);
            ResetPosition(h, pos, rot);
            BattleManager.GetInst().m_CharInScene.AddChar(h);
            return(h);
        }
        public void RemoveConnectChar(int skillInstId, CharHandler charHandler)
        {
            List <ConnectLine> lst = BattleEnum.Enum_CharSide.Mine == charHandler.m_CharData.m_eSide ? _lstConnectMine : _lstConnectEnemy;

            for (int i = 0; i < lst.Count; ++i)
            {
                if (lst[i].m_iSkillInstID == skillInstId)
                {
                    bool bEmpty = lst[i].RemoveChar(charHandler);
                    if (bEmpty)
                    {
                        BattleScenePool.GetInst().PushEffect("Effect/PassiveSkill/ConnectLine", lst[i].m_Transform);
                        lst.RemoveAt(i);
                    }
                    return;
                }
            }
        }
Exemple #7
0
        protected override void Excute(CharHandler charHandler, int index = -1, int skillInstId = -1)
        {
            List <CharHandler> targets = GetTargets(charHandler);

            if (targets.Count > 0)
            {
                for (int i = 0; i < targets.Count; ++i)
                {
                    CharHandler aimHandler = targets[i];
                    BulletBase  bullet     = BattleScenePool.GetInst().PopBullet(charHandler);
                    bullet.Shoot(charHandler, targets[i], () => { BeHitCallback(charHandler, aimHandler); });
                }
            }
            else
            {
                BulletBase bullet = BattleScenePool.GetInst().PopBullet(charHandler);
                bullet.Shoot(charHandler);
            }
        }
        public void AddConnectChar(int skillInstId, CharHandler charHandler, float value)
        {
            List <ConnectLine> lst = BattleEnum.Enum_CharSide.Mine == charHandler.m_CharData.m_eSide ? _lstConnectMine : _lstConnectEnemy;

            for (int i = 0; i < lst.Count; ++i)
            {
                if (lst[i].m_iSkillInstID == skillInstId)
                {
                    lst[i].AddChar(charHandler, value);
                    return;
                }
            }

            Transform   connectTrans = BattleScenePool.GetInst().PopEffect("Effect/PassiveSkill/ConnectLine");
            ConnectLine connectLine  = connectTrans.GetComponent <ConnectLine>();

            lst.Add(connectLine);
            connectLine.m_iSkillInstID = skillInstId;
            connectLine.AddChar(charHandler, value);
        }
Exemple #9
0
        private void _SetEffect(Transform parent)
        {
            string    path        = m_SkillDataSon.m_ReceptorEffect[0];
            Transform effectTrans = BattleScenePool.GetInst().PopEffect(path);

            effectTrans.SetParent(parent);
            effectTrans.localPosition = Vector3.zero;
            funcEnd += (bool bCancel) =>
            {
                BattleScenePool.GetInst().PushEffect(path, effectTrans);

                if (m_SkillDataSon.m_ReceptorEffect.Length > 1)
                {
                    path        = m_SkillDataSon.m_ReceptorEffect[1];
                    effectTrans = BattleScenePool.GetInst().PopEffect(path);
                    effectTrans.SetParent(parent);
                    effectTrans.localPosition = Vector3.zero;

                    BattleScenePool.GetInst().PushEffect(path, effectTrans, 5);
                }
            };
        }
Exemple #10
0
 private void Awake()
 {
     _inst          = this;
     _transform     = transform;
     _monsterConfig = ConfigData.GetValue("Monster_Client");
 }
Exemple #11
0
 private void OnDestroy()
 {
     _inst = null;
 }
Exemple #12
0
 private void _DeadEnd()
 {
     BattleScenePool.GetInst().PushMonsterHandler(this);
 }
Exemple #13
0
 public Transform GetSkillBulletObj(int skillId)
 {
     return(BattleScenePool.GetInst().PopEffect <BulletTrace>(SkillHandler.GetInst().GetSkillDataByID(skillId).m_sBulletPath));
 }