public Weapen GetWeapen(string itemName) { WeapenScriptableObject obj = Resources.Load("AW.WeapenScriptableObject") as WeapenScriptableObject; int index = GetWeapenIdFromString(itemName); if (index == -1) { return(null); } return(obj.weapen_all[index]); }
private void LoadWeapenIds() { WeapenScriptableObject obj = Resources.Load("AW.WeapenScriptableObject") as WeapenScriptableObject; if (obj == null) { Debug.Log("could't find AW.WeapenScriptableObject"); return; } for (int i = 0; i < obj.weapen_all.Count; i++) { if (weapen_Ids.ContainsKey(obj.weapen_all[i].itemName)) { Debug.Log(obj.weapen_all[i].itemName + " item is a duplicae"); } else { weapen_Ids.Add(obj.weapen_all[i].itemName, i); } } }