public void ItemClicked(GameObject go) { if (RPOS.ObservedPlayer.GetComponent <CraftingInventory>().isCrafting) { return; } RPOSCraftItemEntry component = go.GetComponent <RPOSCraftItemEntry>(); if (component == null) { return; } BlueprintDataBlock blueprintDataBlock = component.blueprint; if (!blueprintDataBlock) { Debug.Log("no bp by that name"); return; } if (blueprintDataBlock != this.selectedItem) { this.SetSelectedItem(component.blueprint); this.UpdateIngredients(); } }
public RPOSCraftItemEntry GetEntryByBP(BlueprintDataBlock bp) { IEnumerator enumerator = base.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.Current; RPOSCraftItemEntry component = (current as Transform).GetComponent <RPOSCraftItemEntry>(); if ((component != null) && (component.blueprint == bp)) { return(component); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } return(null); }
public RPOSCraftItemEntry GetEntryByBP(BlueprintDataBlock bp) { RPOSCraftItemEntry rPOSCraftItemEntry; IEnumerator enumerator = base.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { RPOSCraftItemEntry component = (enumerator.Current as Transform).GetComponent <RPOSCraftItemEntry>(); if (!component || !(component.blueprint == bp)) { continue; } rPOSCraftItemEntry = component; return(rPOSCraftItemEntry); } return(null); } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } return(rPOSCraftItemEntry); }