本文整理汇总了C#中ProgressBar.SetInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.SetInfo方法的具体用法?C# ProgressBar.SetInfo怎么用?C# ProgressBar.SetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.SetInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetInfo
public void SetInfo(ShipInfo info) {
_shipInfo = info;
_shipClassText = transform.Find("ShipClassText").GetComponent<Text>();
_shipClassImage = transform.Find("ShipClassImage").GetComponent<Image>();
_nameText = transform.Find("Name").GetComponent<Text>();
_statusText = transform.Find("Status").GetComponent<Text>();
_originTransform = transform.Find("Origin").GetComponent<RectTransform>();
_originImage = transform.Find("Origin/Image").GetComponent<Image>();
_originText = transform.Find("Origin/Text").GetComponent<Text>();
_destinationTransform = transform.Find("Destination").GetComponent<RectTransform>();
_destinationImage = transform.Find("Destination/Image").GetComponent<Image>();
_destinationText = transform.Find("Destination/Text").GetComponent<Text>();
_travelButton = transform.Find("TravelButton").GetComponent<Button>();
_progressBar = transform.Find("ProgressBar").GetComponent<ProgressBar>();
_progressBar.SetInfo(info);
NameText = info.name;
ShipClass = info.ship_class;
OriginID = (uint)info.origin_planet;
DestinationID = (uint)info.destination_planet;
if (info.origin_planet != 0 && info.destination_planet != 0) {
StatusText = "On Route";
_travelButton.interactable = false;
StatusColor = Color.red;
}
else if (info.origin_planet == 0 && info.destination_planet != 0) {
StatusText = "Arrived";
_travelButton.interactable = true;
StatusColor = Color.blue;
}
else if (info.origin_planet != 0 && info.destination_planet == 0) {
StatusText = "Ready";
_travelButton.interactable = true;
StatusColor = Color.green;
}
_travelButton.onClick.AddListener(() => BeginLaunchSetup());
}