public void Sell(long count, long value, CurrencyType currencyType) { if (save.itemsCostMoney) { value = value * count; save[currencyType] += value; switch (currencyType) { case CurrencyType.Money: moneyChanged.Invoke(); break; case CurrencyType.Xp: xpChanged.Invoke(); break; case CurrencyType.Level: levelChanged.Invoke(); break; } CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, currencyType, CurrencyEventType.ItemSold, "Item"); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
private void _OnSpend(object sender, CurrencyEvent e) { if (e.currency != currency) { return; } if (e.to >= e.from) { return; } StartCoroutine(_Lob(e.currency, (ulong)(e.from - e.to), true)); }
public void SellMachine(MachineInfo machineInfo) { if (save.itemsCostMoney) { long value = machineInfo.cost; save.money += value; moneyChanged.Invoke(); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.MachineSold, machineInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void RefundItem(ItemInfo itemInfo, int count) { if (save.itemsCostMoney) { long value = itemInfo.value * count; save.money += value; CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.ItemRefunded, itemInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); moneyChanged.Invoke(); } }
public void MachinePurchaserBuyItem(ItemInfo itemInfo, int count) { if (save.itemsCostMoney) { long value = itemInfo.value * count; save.money -= value; moneyChanged.Invoke(); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Sink, CurrencyType.Money, CurrencyEventType.MachinePurchaserFees, itemInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void Buy(long count, long value, CurrencyType currencyType) { if (save.itemsCostMoney) { value = value * count; save[currencyType] -= value; moneyChanged.Invoke(); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Sink, currencyType, CurrencyEventType.ItemPurchased, "Item"); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void SellConveyor() { if (save.itemsCostMoney) { long value = conveyorCost; save.money += value; moneyChanged.Invoke(); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.ConveyorSold, "Conveyor"); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void BuyConveyors(int count) { if (save.itemsCostMoney) { long value = conveyorCost * count; save.money -= value; moneyChanged.Invoke(); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Sink, CurrencyType.Money, CurrencyEventType.ConveyorPurchased, "Conveyor"); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void MachineSellerSellItem(ItemInfo itemInfo, int count, Vector3 position) { if (save.itemsCostMoney) { long value = itemInfo.value * count; save.money += value; moneyChanged.Invoke(); CurrencyMoney currency = ObjectPooler.instance.Get <CurrencyMoney>(); currency.Initialize(position); CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.MachineSellerRevenue, itemInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } }
public void RefundInventory(Inventory inventory) { if (save.itemsCostMoney) { long valueSum = 0; for (int i = 0, len = inventory.slots.Length; i < len; ++i) { InventorySlot slot = inventory.slots[i]; if (slot.count > 0) { long value = slot.itemInfo.value * slot.count; valueSum += value; CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.ItemRefunded, slot.itemInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); } } save.money += valueSum; moneyChanged.Invoke(); } }
public void ProgressionReward(ProgressionInfo progressionInfo) { if (progressionInfo.moneyReward > 0) { long value = progressionInfo.moneyReward; save.money += value; CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Money, CurrencyEventType.ProgressionReward, progressionInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); moneyChanged.Invoke(); } if (progressionInfo.xpReward > 0) { long value = progressionInfo.xpReward; save.xp += value; CurrencyEvent currencyEvent = new CurrencyEvent(GAResourceFlowType.Source, CurrencyType.Xp, CurrencyEventType.ProgressionReward, progressionInfo); Analytics.instance.NewCurrencyEvent(currencyEvent, value); xpChanged.Invoke(); } }
private void OnChange(object sender, CurrencyEvent currencyEvent) { ActiveManager.Check(); }
private void OnChange(object sender, CurrencyEvent currencyEvent) { MyUpdate(); }
private void OnChange(object sender, CurrencyEvent currencyEvent) { _text.Lerp(currencyEvent.to); }