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); } }
//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); } }
//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); } }
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; } } }
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); }