public void Populate(QuestTask task) { payload = JsonUtility.FromJson <TaskPayload_Numeric>(task.payload); jumpInButton.gameObject.SetActive(task.progress < 1 && !string.IsNullOrEmpty(task.coordinates)); jumpInDelegate = () => WebInterface.SendChatMessage(new ChatMessage { messageType = ChatMessage.Type.NONE, recipient = string.Empty, body = $"/goto {task.coordinates}", }); taskName.text = task.name; progressText.text = $"{payload.current}/{payload.end}"; status.isOn = task.progress >= 1; ongoingProgress.transform.localScale = new Vector3(task.progress, 1, 1); ongoingProgress.color = task.progress < 1 ? ongoinColor : completedcolor; }
public void Populate(QuestTask task) { payload = JsonUtility.FromJson <TaskPayload_Numeric>(task.payload); jumpInButton.gameObject.SetActive(task.progress < 1 && !string.IsNullOrEmpty(task.coordinates)); jumpInDelegate = () => WebInterface.SendChatMessage(new ChatMessage { messageType = ChatMessage.Type.NONE, recipient = string.Empty, body = $"/goto {task.coordinates}", }); taskName.text = task.name; start.text = payload.start.ToString(); current.text = payload.current.ToString(); end.text = payload.end.ToString(); ongoingProgress.fillAmount = task.progress; }