コード例 #1
0
        void Awake()
        {
            gameObject.GetComponent <Collider>().isTrigger = true;
            gameObject.layer = TDS.GetLayerCollectible();

            if (type == _CollectType.Self)
            {
                //initiate the weapon list to contain all weapon if the condition is checked
                if (gainWeapon && randomWeapon && enableAllWeapon)
                {
                    weaponList = new List <Weapon>(WeaponDB.Load());
                }

                //make sure none of the element in weaponList is null
                for (int i = 0; i < weaponList.Count; i++)
                {
                    if (weaponList[i] == null)
                    {
                        weaponList.RemoveAt(i); i -= 1;
                    }
                }
            }

            //effect=EffectDB.CloneItem(effectID);
            effectIdx = EffectDB.GetEffectIndex(effectID);

            if (triggerEffectObj != null)
            {
                ObjectPoolManager.New(triggerEffectObj, 1);
            }
        }
コード例 #2
0
ファイル: UnitPlayer.cs プロジェクト: shibuzhuan/CovKnight
        //for perk that modify the weapon attack effect
        public void ChangeAllWeaponEffect(int effectID)
        {
            int effectIndex = EffectDB.GetEffectIndex(effectID);

            for (int i = 0; i < weaponList.Count; i++)
            {
                weaponList[i].ChangeEffect(effectID, effectIndex);
            }
        }
コード例 #3
0
ファイル: UnitPlayer.cs プロジェクト: shibuzhuan/CovKnight
        //for perk that modify the ability attack effect
        public void ChangeAllAbilityEffect(int effectID)
        {
            int            effectIndex = EffectDB.GetEffectIndex(effectID);
            List <Ability> abList      = AbilityManager.GetAbilityList();

            for (int i = 0; i < abList.Count; i++)
            {
                abList[i].ChangeEffect(effectID, effectIndex);
            }
        }
コード例 #4
0
ファイル: UnitPlayer.cs プロジェクト: shibuzhuan/CovKnight
        public void ChangeWeaponEffect(int weaponID, int effectID)
        {
            int effectIndex = EffectDB.GetEffectIndex(effectID);

            for (int i = 0; i < weaponList.Count; i++)
            {
                if (weaponList[i].ID == weaponID)
                {
                    weaponList[i].ChangeEffect(effectID, effectIndex);
                    break;
                }
            }
        }
コード例 #5
0
        public int effectIdx = -1;              //effect'sindex to effectlist in DB during runtime
        //[HideInInspector] public Effect effect=null;


        public void Init()
        {
            //clone the effect so the original in DB wont get modified
            //effect=EffectDB.CloneItem(effectID);
            effectIdx = EffectDB.GetEffectIndex(effectID);
        }