コード例 #1
0
    public void CreateResourceInfoView(OSTData.ResourceElement.ResourceType t)
    {
        ResourceInfosView newObj = Instantiate <ResourceInfosView>(resourceInfoViewPrefab);
        Window            window = winSystem.NewWindow("Resource Info", newObj.gameObject);

        window.Title = "resource info";
        newObj.SetData(t);
    }
コード例 #2
0
    public void SetData(OSTData.ResourceElement.ResourceType type)
    {
        DataModel model = FindObjectOfType <DataModel>();

        resName.text = type.ToString();
        foreach (var s in model.Universe.GetStations())
        {
            if (s.IsProducing(type))
            {
                ResourceProducerLine line = Instantiate <ResourceProducerLine>(producerLinePrefab);
                line.transform.SetParent(producerContent);
                line.SetStation(s);
                line.SetPrice(0);
            }
            if (s.Buyings.Contains(type))
            {
                ResourceProducerLine line = Instantiate <ResourceProducerLine>(producerLinePrefab);
                line.transform.SetParent(consumerContent);
                line.SetStation(s);
                line.SetPrice(s.GetBuyingPrice(type));
            }
        }
    }
コード例 #3
0
 public void SetType(OSTData.ResourceElement.ResourceType type)
 {
     _type         = type;
     nameText.text = type.ToString();
 }