private void LoadPlayer(int pers = 0) { string type = Perso != "" ? Perso : StaticData.PlayerChoice; pers = pers == 0 ? FindClass(type) : pers - 1; PlayerDataSave data = SaveSystem.LoadPlayer(type); if (data == null) { /* ResetStats(pers); * * GamesItem ite = FindItems(0); * Weapons i = ScriptableObject.CreateInstance<Weapons>(); * i.Create(ite as Weapons, 0); * * _playerData.Inventory.Weapon = i; */ return; } ResetStats(pers, data.Lvl); _playerData.Xp = data.Xp; GamesItem item = FindItems(data.weapon); Weapons it = ScriptableObject.CreateInstance <Weapons>(); it.Create(item as Weapons, data.weaponLvl); _playerData.Inventory.AddItem(it, Vector3.zero); _playerData.StateProj = it.EffectType; _playerData.Inventory.Potions = new Potions[4]; }
public void RemoveOtherWeapons(IEventArgs itemArg) { GamesItem item = (itemArg as EventArgsItemAth).Item; if (item is Potions potions && _otherPotionsA.Pot == potions) { _otherPotionsA.SetPotion(null); _otherPotionsT.SetActive(false); }
private void LoadPlayer(int pers = 0) { string type = Perso != "" ? Perso : StaticData.PlayerChoice; pers = pers == 0 ? FindClass(type) : pers - 1; PlayerDataSave data = SaveSystem.LoadPlayer(type); if (data == null) { ResetStats(pers); GamesItem ite = FindItems(0); Weapons i = ScriptableObject.CreateInstance <Weapons>(); i.Create(ite as Weapons, 0); _playerData.Inventory.Weapon = i; _playerData.CompPoint = 0; return; } ResetStats(pers, data.Lvl); _playerData.Xp = data.Xp; _playerData.CompPoint = data.CompPoint; for (int i = 0; i < 4; i++) { for (int j = 0; j < data.Lvl[i + 1]; j++) { _playerData.Competences[i].UpgradeStats(); } } GamesItem item = FindItems(data.weapon); Weapons it = ScriptableObject.CreateInstance <Weapons>(); it.Create(item as Weapons, data.weaponLvl); _playerData.Inventory.AddItem(it, Vector3.zero); _playerData.StateProj = it.EffectType; _playerData.Inventory.Potions = new Potions[4]; }
public void AddOtherWeapons(IEventArgs itemArg) { GamesItem item = (itemArg as EventArgsItemAth).Item; if (item is Potions potions) { _otherPotionsT.SetActive(true); _otherWeaponsT.SetActive(false); _otherPotionsA.SetPotion(potions); } else if (item is Weapons weapons) { _otherPotionsT.SetActive(false); _otherWeaponsT.SetActive(true); _otherWeaponsA.SetWeapons(weapons); } }
private int ItemNull(GamesItem item) { return(item == null ? 0 : item.id); }
public EventArgsItemAth(GamesItem item) { _item = item; }
public EventArgsItem(GamesItem item, Transform t) { _item = item; _t = t; }