void SetCard() { bool showOneTask = false; TaskStrip temp = TaskStrips[0]; TaskStrips[0] = TaskStrips[1]; TaskStrips[1] = temp; temp = null; if (TaskManager.PreviousTask == null || TaskManager.CurrentTask == TaskManager.PreviousTask || (currentCardIndex == TaskManager.CardIndex && currentTaskIndex == TaskManager.TaskIndex)) { showOneTask = true; TaskStrips[0].transform.parent.gameObject.SetActive(true); TaskStrips[1].transform.parent.gameObject.SetActive(false); } else { TaskStrips[0].transform.parent.gameObject.SetActive(true); TaskStrips[1].transform.parent.gameObject.SetActive(true); } TaskStripsRectTransform[0] = TaskStrips[0].GetComponent <RectTransform>(); TaskStripsRectTransform[1] = TaskStrips[1].GetComponent <RectTransform>(); Card cardNew = TaskManager.CurrentCard; Card cardOld = TaskManager.GetCard(currentCardIndex); string firstPart = TextsBridge.ReverseHebrewName("סיימת שלב "); string endPart = TextsBridge.ReverseHebrewName(", עבור לשלב "); TaskStrips[0].SetTaskText(cardNew.name + endPart + cardOld.name + firstPart); TaskStrips[0].ShowInfoIcon(false); TaskStrips[0].ShowValidationIcon(false); TaskStrips[0].SetValidated(false); if (TaskManager.PreviousTask != null) { TaskStrips[1].SetValidated(TaskManager.PreviousTask.isAlreadySigned); } TaskStrips[0].TaskText.GetComponent <ContentSizeFitter>().SetLayoutHorizontal(); TaskStrips[0].TaskText.GetComponent <ContentSizeFitter>().SetLayoutVertical(); currentTaskIndex = TaskManager.TaskIndex; if (showOneTask) { TaskStripsRectTransform[0].anchoredPosition3D = inEndPos; return; } animate = true; index = 0; rate = 1.0f / enterSpeed; if (TaskManager.PreviousTask != null) { curDelay = TaskManager.PreviousTask.isAlreadySigned ? delay : 0; } timeForNextCard = RecordingsManager.Instance.GetLengthForNextCard(); }
void SetTask() { bool showOneTask = false; TaskStrip temp = TaskStrips[0]; TaskStrips[0] = TaskStrips[1]; TaskStrips[1] = temp; temp = null; if (TaskManager.PreviousTask == null || TaskManager.CurrentTask == TaskManager.PreviousTask || (!cardChanged && currentCardIndex == TaskManager.CardIndex && currentTaskIndex == TaskManager.TaskIndex)) { showOneTask = true; TaskStrips[0].transform.parent.gameObject.SetActive(true); TaskStrips[1].transform.parent.gameObject.SetActive(false); } else { TaskStrips[0].transform.parent.gameObject.SetActive(true); TaskStrips[1].transform.parent.gameObject.SetActive(true); } cardChanged = false; TaskStripsRectTransform[0] = TaskStrips[0].GetComponent <RectTransform>(); TaskStripsRectTransform[1] = TaskStrips[1].GetComponent <RectTransform>(); Task task = TaskManager.CurrentTask; TaskStrips[0].SetTaskText(task.instruction); TaskStrips[0].ShowInfoIcon(!string.IsNullOrEmpty(task.hasExtraInfo)); TaskStrips[0].ShowValidationIcon(task.signedTask); TaskStrips[0].SetValidated(task.isAlreadySigned); if (TaskManager.PreviousTask != null) { TaskStrips[1].SetValidated(TaskManager.PreviousTask.isAlreadySigned); } TaskStrips[0].TaskText.GetComponent <ContentSizeFitter>().SetLayoutHorizontal(); TaskStrips[0].TaskText.GetComponent <ContentSizeFitter>().SetLayoutVertical(); currentTaskIndex = TaskManager.TaskIndex; if (showOneTask) { TaskStripsRectTransform[0].anchoredPosition3D = inEndPos; return; } animate = true; index = 0; rate = 1.0f / enterSpeed; if (TaskManager.PreviousTask != null) { curDelay = TaskManager.PreviousTask.isAlreadySigned ? delay : 0; } }