Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
 void OnDestroy()
 {
     singletonInstance = null;
 }
Esempio n. 3
0
 void Awake()
 {
     if (singletonInstance != null)
         Debug.LogError("have singletonInstance");
     singletonInstance = this;
     init();
 }