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); }
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)); } } }
public void SetType(OSTData.ResourceElement.ResourceType type) { _type = type; nameText.text = type.ToString(); }