// Update is called once per frame\\\\\\
    void Update()
    {
        if (Input.GetMouseButtonDown(1))
        {
            _sender.Publish("button.press.begin");
            _sender.Publish("boxselectable.select.toggle");
        }
        else if (Input.GetMouseButtonUp(1))
        {
            _sender.Publish("button.press.end");
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
#if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
#else
            Application.Quit();
#endif
        }

        if (Input.GetKey(KeyCode.Space) && Input.GetKey(KeyCode.M))
        {
            _rm.DepositFunds(5_000_000 * Time.deltaTime);
        }
    }
 public void RegisterTradeRoute(TradeRoute tradeRoute)
 {
     if (TradeRoutes.Contains(tradeRoute))
     {
         return;
     }
     TradeRoutes.Add(tradeRoute);
     _sender.Publish("oilextractor.traderoute.changed", this);
 }
    void PublishOilUpdate()
    {
        CurrentOilPrice = (Decimal)Math.Round((EnvironmentHealth + PublicSentiment) * 100f) / 200;

        PrimaryInfoCardResourcesOilUpdate dollarsUpdate = new PrimaryInfoCardResourcesOilUpdate
        {
            oilPrice             = CurrentOilPrice,
            oilProducedPerSecond = (decimal)oilProductionRunningAvg.CalculatedAverage(),
            oilConsumedPerSecond = (decimal)oilExportRunningAvg.CalculatedAverage(),
        };

        _sender.Publish("game.oil.totals", dollarsUpdate);
    }
Пример #4
0
 // Update is called once per frame
 void Update()
 {
     elapsedTime += Time.deltaTime;
     GameTime.Instance.SetElapsedTime(elapsedTime);
     _sender.Publish("game.date", GameTime.Instance.GameDate());
 }
Пример #5
0
    public void Buy()
    {
        PubSubSender sender = gameObject.GetComponent <PubSubSender>();

        sender.Publish("oilslick.purchase", oilSlick);
    }
 public void Selected()
 {
     if (isSelected)
     {
         return;
     }
     isSelected = true;
     _sender.Publish(SelectionType + ".gameobject.select", this.gameObject);
 }
    public override void OnPointerEnter(PointerEventData eventData)
    {
        base.OnPointerEnter(eventData);

        _sender.Publish("button.highlight.begin");
    }