public Equip ( InvGameItem, item ) : InvGameItem, | ||
item | InvGameItem, | |
Результат | InvGameItem, |
void Start() { if (itemIDs != null && itemIDs.Length > 0) { InvEquipment eq = GetComponent <InvEquipment>(); if (eq == null) { eq = gameObject.AddComponent <InvEquipment>(); } int qualityLevels = (int)InvGameItem.Quality._LastDoNotUse; for (int i = 0, imax = itemIDs.Length; i < imax; ++i) { int index = itemIDs[i]; InvBaseItem item = InvDatabase.FindByID(index); if (item != null) { InvGameItem gi = new InvGameItem(index, item); gi.quality = (InvGameItem.Quality)Random.Range(0, qualityLevels); gi.itemLevel = NGUITools.RandomRange(item.minItemLevel, item.maxItemLevel); eq.Equip(gi); } else { Debug.LogWarning("Can't resolve the item ID of " + index); } } } Destroy(this); }
private void Start() { if (this.itemIDs != null && this.itemIDs.Length > 0) { InvEquipment invEquipment = base.GetComponent <InvEquipment>(); if (invEquipment == null) { invEquipment = base.gameObject.AddComponent <InvEquipment>(); } int max = 12; int i = 0; int num = this.itemIDs.Length; while (i < num) { int num2 = this.itemIDs[i]; InvBaseItem invBaseItem = InvDatabase.FindByID(num2); if (invBaseItem != null) { invEquipment.Equip(new InvGameItem(num2, invBaseItem) { quality = (InvGameItem.Quality)UnityEngine.Random.Range(0, max), itemLevel = NGUITools.RandomRange(invBaseItem.minItemLevel, invBaseItem.maxItemLevel) }); } else { Debug.LogWarning("Can't resolve the item ID of " + num2); } i++; } } UnityEngine.Object.Destroy(this); }
private void Start() { if ((this.itemIDs != null) && (this.itemIDs.Length > 0)) { InvEquipment component = base.GetComponent <InvEquipment>(); if (component == null) { component = base.gameObject.AddComponent <InvEquipment>(); } int max = 12; int index = 0; int length = this.itemIDs.Length; while (index < length) { int num4 = this.itemIDs[index]; InvBaseItem bi = InvDatabase.FindByID(num4); if (bi != null) { InvGameItem item = new InvGameItem(num4, bi) { quality = (InvGameItem.Quality)UnityEngine.Random.Range(0, max), itemLevel = NGUITools.RandomRange(bi.minItemLevel, bi.maxItemLevel) }; component.Equip(item); } else { Debug.LogWarning("Can't resolve the item ID of " + num4); } index++; } } UnityEngine.Object.Destroy(this); }
private void Start() { if (itemIDs != null && itemIDs.Length > 0) { InvEquipment invEquipment = GetComponent <InvEquipment>(); if (invEquipment == null) { invEquipment = base.gameObject.AddComponent <InvEquipment>(); } int max = 12; int i = 0; for (int num = itemIDs.Length; i < num; i++) { int num2 = itemIDs[i]; InvBaseItem invBaseItem = InvDatabase.FindByID(num2); if (invBaseItem != null) { InvGameItem invGameItem = new InvGameItem(num2, invBaseItem); invGameItem.quality = (InvGameItem.Quality)Random.Range(0, max); invGameItem.itemLevel = NGUITools.RandomRange(invBaseItem.minItemLevel, invBaseItem.maxItemLevel); invEquipment.Equip(invGameItem); } else { Debug.LogWarning("Can't resolve the item ID of " + num2); } } } Object.Destroy(this); }
private void OnClick() { if (!(equipment == null)) { List <InvBaseItem> items = InvDatabase.list[0].items; if (items.Count != 0) { int max = 12; int num = Random.Range(0, items.Count); InvBaseItem invBaseItem = items[num]; InvGameItem invGameItem = new InvGameItem(num, invBaseItem); invGameItem.quality = (InvGameItem.Quality)Random.Range(0, max); invGameItem.itemLevel = NGUITools.RandomRange(invBaseItem.minItemLevel, invBaseItem.maxItemLevel); equipment.Equip(invGameItem); } } }
private void OnClick() { if (equipment != null) { var items = InvDatabase.list[0].items; if (items.Count != 0) { var max = 12; var id = Random.Range(0, items.Count); var bi = items[id]; var item = new InvGameItem(id, bi) { quality = (InvGameItem.Quality)Random.Range(0, max), itemLevel = NGUITools.RandomRange(bi.minItemLevel, bi.maxItemLevel) }; equipment.Equip(item); } } }
void OnClick() { if (equipment == null) { return; } List <InvBaseItem> list = InvDatabase.list[0].items; if (list.Count == 0) { return; } int qualityLevels = (int)InvGameItem.Quality._LastDoNotUse; int index = Random.Range(0, list.Count); InvBaseItem item = list[index]; InvGameItem gi = new InvGameItem(index, item); gi.quality = (InvGameItem.Quality)Random.Range(0, qualityLevels); gi.itemLevel = NGUITools.RandomRange(item.minItemLevel, item.maxItemLevel); equipment.Equip(gi); }