Example #1
0
    void AddALine()
    {
        if (null == m_DataDiagram)
        {
            return;
        }

        Color      color = Color.HSVToRGB((h += 0.1f) > 1 ? (h - 1) : h, 0.8f, 0.8f);
        GameObject line  = m_DataDiagram.AddLine(color.ToString(), color);

        if (null != line)
        {
            lineList.Add(line);
        }
    }
    void viewGoodResource()
    {
        plus.interactable   = false;
        minus.interactable  = false;
        offer.isOn          = false;
        bid.isOn            = false;
        High.interactable   = false;
        Medium.interactable = false;
        Low.interactable    = false;
        Debug.Log("Was clicked");
        App    app         = UnityEngine.Object.FindObjectOfType <App>();
        int    playerIndex = app.GetHumanIndex();
        Nation player      = State.getNations()[playerIndex];
        Market market      = State.market;

        MarketHelper.currentItem = SelectionButton.transform.parent.parent.name;
        Debug.Log("Grandparent name: " + currentItem);
        if (ress.Contains(currentItem))
        {
            itemImage.sprite = Resources.Load("Resource/" + currentItem, typeof(Sprite)) as Sprite;
            MyEnum.Resources _item = (MyEnum.Resources)Enum.Parse(typeof(MyEnum.Resources), currentItem);
            numOffBid.text = MarketHelper.ResourceOfferBidAmount[_item].ToString();

            if (State.turn > 1)
            {
                offeredLastTurn.text = "Offered Last Turn: " + market.getNumberOfResourcesOffered(_item).ToString();
                soldLastTurn.text    = "Sold Last Turn: " + market.getNumberResourcesSold(_item).ToString();
            }
            else
            {
                offeredLastTurn.text = "Offered Last Turn: 0";
                soldLastTurn.text    = "Sold Last Turn: 0";
            }
            priceHistory = market.getResourcePriceHistory(_item);
        }
        else
        {
            itemImage.sprite = Resources.Load("FinishedGoods/" + currentItem, typeof(Sprite)) as Sprite;
            MyEnum.Goods _item = (MyEnum.Goods)Enum.Parse(typeof(MyEnum.Goods), currentItem);
            numOffBid.text = MarketHelper.GoodsOfferBidAmount[_item].ToString();
            if (State.turn > 1)
            {
                offeredLastTurn.text = "Offered Last Turn: " + market.getNumberGoodsOffered(_item).ToString();
                soldLastTurn.text    = "Sold Last Turn: " + market.getNumberOfGoodsSoldLastTurn(_item).ToString();
                priceHistory         = market.getGoodPriceHistory(_item);
            }
            else
            {
                offeredLastTurn.text = "Offered Last Turn: 0";
                soldLastTurn.text    = "Sold Last Turn: 0";
            }
            priceHistory = market.getGoodPriceHistory(_item);
        }

        GameObject history = dataDiagram.AddLine(player.getName(), player.getColor());

        for (int i = 0; i < priceHistory.Count; i++)
        {
            dataDiagram.InputPoint(history, new Vector2(i, priceHistory[i]));
        }
    }
Example #3
0
 private void Start()
 {
     line = diagram.AddLine("ピカチュウ", Color.yellow);
 }
Example #4
0
 private void Start()
 {
     line = diagram.AddLine("SCORE", Color.yellow);
 }