// Update is called once per frame void Update() { if (shipController == null) { return; } /* * if (isGreenSignal) { * greenButton.gameObject.SetActive(true); * redButton.gameObject.SetActive(false); * } else { * greenButton.gameObject.SetActive(false); * redButton.gameObject.SetActive(true); * } */ Ship ship = shipController.Ship; int priorityValue = shipController.GetShipPriority() + 1; if (!inDecisionMode) { priority.text = priorityValue.ToString(); } gameObject.GetComponent <RectTransform> ().anchoredPosition = new Vector3(0, GetEntryYPos(), 0); status.text = shipController.status.ToString(); shipName.text = ship.Name; type.text = ship.Industry.ToString(); type.color = IndustryColor.GetIndustryColor(ship.Industry); amount.text = string.Format("{0:N0}", ship.cargo); value.text = string.Format("${0:N0}", ship.value * ship.cargo); dueTime.text = ship.dueTime.ToString(Map.DateTimeFormat); DateTime unloadingEta = shipController.GetUnloadlingEta(); if (unloadingEta == DateTime.MinValue) { eta.text = " - "; } else { eta.text = unloadingEta.ToString(Map.DateTimeFormat); } if (unloadingEta > ship.dueTime) { eta.color = Color.red; } else { eta.color = Color.white; } }
private void ChangeThumbnailColorByIndustry() { Color color = IndustryColor.GetIndustryColor(ship.Industry); Thumbnail.GetComponent <SpriteRenderer>().color = color; }