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); }
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 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 EquipmentDetailViewModel CreateNewEquipment(InvFacility facility) { var equipment = new InvEquipment() { SYNC_ID = Guid.NewGuid(), EquipmentID = "Equipment-0000", InvFacilityId = facility.SYNC_ID, } ; return(new EquipmentDetailViewModel(equipment, this._applicationContext, EventAggregator)); }