void addItemElements(WMItemSystem.InfoNode pNode, float pDiscount) { foreach (var lElement in pNode.elements) { addItemElement(lElement.id, (int)(lElement.buyingPrice * pDiscount), (int)(lElement.sellingPrice * pDiscount)); } foreach (var lNode in pNode.nodes) { float lDiscount; if (typeNameToDiscount.TryGetValue(lNode.name, out lDiscount)) addItemElements(lNode, lDiscount); else addItemElements(lNode, pDiscount); } }
void OnDestroy() { singletonInstance = null; }
void Awake() { if (singletonInstance != null) Debug.LogError("have singletonInstance"); singletonInstance = this; init(); }