public void LoadPersistantData() { // load carry over value from task into pointer. if (currentTask != null) { currentTask.GetStringValue("persistantData", out persistantData); } }
void updateTaskInfo(StoryPointer pointer) { StoryTask theTask = pointer.currentTask; if (theTask == null || theTask.Pointer.pointerObject == null) { return; } if (theTask.Instruction != "wait") { //string displayText; string displayText = theTask.scope == SCOPE.GLOBAL ? "G| " : "L| "; // if (theTask.scope == SCOPE.GLOBAL) //{ // displayText = "G | "; //} //else //{ // displayText = "L | "; //} displayText = displayText + theTask.Instruction + " | "; // If a task has a value for "debug" we display it along with task description. string debugText; if (theTask.GetStringValue("debug", out debugText)) { displayText = displayText + debugText; } theTask.Pointer.deusText.text = displayText; theTask.Pointer.deusTextSuper.text = theTask.Pointer.currentPoint.StoryLine + " " + GENERAL.ALLPOINTERS.Count; } else { theTask.Pointer.deusTextSuper.text = theTask.Pointer.currentPoint.StoryLine; } }
void updateTaskDisplays() { if (PointerBlock == null || DebugCanvas == null) { Warning("Set references for pointerblock and deuscanvas."); return; } // Go over all pointers and plot them into our diplay for (int i = 0; i < GENERAL.ALLPOINTERS.Count; i++) { StoryPointer pointer = GENERAL.ALLPOINTERS[i]; if (!itemList.Exists(x => x.StoryPointer == pointer)) { Item ni = new Item(pointer, PointerBlock); ni.displayObject.transform.SetParent(DebugCanvas.transform, false); itemList.Add(ni); } } // Log("datacount " + GENERAL.ALLDATA.Count); // Go over all data objects and plot them into our diplay /* * for (int i = 0; i < GENERAL.ALLDATA.Count; i++) * { * * StoryData data = GENERAL.ALLDATA[i]; * * if (!itemList.Exists(x => x.StoryData == data)) * { * // Log("addin gitem"); * Item ni = new Item(data, PointerBlock); * ni.displayObject.transform.SetParent(DeusCanvas.transform, false); * * itemList.Add(ni); * * } * * } */ // Go over all items backwards and remove any for (int i = itemList.Count - 1; i >= 0; i--) { if (itemList[i].TimeOut != 0 && itemList[i].TimeOut < Time.time) { Destroy(itemList[i].displayObject); itemList.RemoveAt(i); } } // Go over all display items and update them. for (int i = 0; i < itemList.Count; i++) { int row = i / PointerDisplayCols; int col = i % PointerDisplayCols; float scale = 1f / PointerDisplayCols; Item item = itemList[i]; // item.displayObject.GetComponent<RectTransform>().localPosition = scale * new Vector3(PointerDisplayCols / 2f * -1024f + 512f + col * 1024f, PointerDisplayRows / 2f * 512f - 256f - row * 512f, 0); item.displayObject.GetComponent <RectTransform>().localPosition = scale * new Vector3(PointerDisplayCols / 2f * -1024f + 512f + col * 1024f, PointerDisplayRows / 2f * 512f - 256f - row * 512f, 0); item.displayObject.GetComponent <RectTransform>().localScale = new Vector3(scale, scale, scale); switch (item.Type) { case Item.TYPE.POINTER: if (item.TimeOut == 0 && !GENERAL.ALLPOINTERS.Contains(item.StoryPointer)) { item.TimeOut = Time.time + 1f; } StoryTask theTask = item.StoryPointer.currentTask; if (theTask == null || item.displayObject == null) { return; } if (theTask.Instruction != "wait" && theTask.Instruction != "end") { // string displayText = theTask.scope == SCOPE.GLOBAL ? "G| " : "L| "; string displayText = theTask.Instruction; // If a task has a value for "debug" we display it along with task description. string debugText; if (theTask.GetStringValue("debug", out debugText)) { displayText = displayText + " | " + debugText; } item.deusText.text = displayText; item.deusTextSuper.text = theTask.Pointer.currentPoint.StoryLine + " " + GENERAL.ALLPOINTERS.Count + (theTask.scope == SCOPE.GLOBAL ? " G" : " L"); } else { item.deusTextSuper.text = theTask.Pointer.currentPoint.StoryLine; } break; case Item.TYPE.DATA: /* * item.deusText.text = item.StoryData.GetChangeLog(); * item.deusTextSuper.text = "data: " + item.StoryData.ID + GENERAL.ALLDATA.Count; */ break; default: break; } } }