Beispiel #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>(Weapon_DB.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 = Effect_DB.GetEffectIndex(effectID);

            if (triggerEffectObj != null)
            {
                ObjectPoolManager.New(triggerEffectObj, 1);
            }
        }
Beispiel #2
0
        //for perk that modify the weapon attack effect
        public void ChangeAllWeaponEffect(int effectID)
        {
            int effectIndex = Effect_DB.GetEffectIndex(effectID);

            for (int i = 0; i < weaponList.Count; i++)
            {
                weaponList[i].ChangeEffect(effectID, effectIndex);
            }
        }
Beispiel #3
0
        //for perk that modify the ability attack effect
        public void ChangeAllAbilityEffect(int effectID)
        {
            int            effectIndex = Effect_DB.GetEffectIndex(effectID);
            List <Ability> abList      = AbilityManager.GetAbilityList();

            for (int i = 0; i < abList.Count; i++)
            {
                abList[i].ChangeEffect(effectID, effectIndex);
            }
        }
Beispiel #4
0
        public void ChangeWeaponEffect(int weaponID, int effectID)
        {
            int effectIndex = Effect_DB.GetEffectIndex(effectID);

            for (int i = 0; i < weaponList.Count; i++)
            {
                if (weaponList[i].ID == weaponID)
                {
                    weaponList[i].ChangeEffect(effectID, effectIndex);
                    break;
                }
            }
        }
Beispiel #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 = Effect_DB.GetEffectIndex(effectID);
        }