public Node GetFront(Node curNode, bool showableOnly = false) { Node node = null; node = curNode.GetFront(showableOnly); if (node != null) { return(node); } if (curNode.sectionId == 0) { return(null); } GraphCanvasType canvas = ChatManager.Instance.LoadSectionByID(curPairID, curNode.sectionId - 1); if (showableOnly && canvas.GetLast() is SetParamNode) { return(GetFront(canvas.GetLast(), showableOnly)); } return(canvas.GetLast()); }
Node GetFront(Node curNode) { Node node = null; node = curNode.GetFront(); if (node != null) { return(node); } if (curNode.sectionId == 0) { return(null); } GraphCanvasType canvas = ChatManager.Instance.LoadSectionByID(curPairID, curNode.sectionId - 1); return(canvas.GetLast()); }
public void OnInit(int friendId) { ChatManager.Instance.curExecuteInstance = this; int pairId = ChatManager.Instance.GetPairID(curUserId, friendId); this.friendId = friendId; this.friendData = XMLSaver.saveData.GetAccountData(friendId); this.friendName = friendData.enname; curPairID = pairId; saveData = XMLSaver.saveData.GetInstanceData(curPairID); lastChatTimeStamp = saveData.lastChatTimeStamp; curSection = ChatManager.Instance.LoadSectionByID(curPairID, saveData.curSectionId); Node front = null; if (saveData.curNodeId >= 0) { curRunningNode = curSection.nodes[saveData.curNodeId]; front = curRunningNode.GetFront(); } else if (saveData.curNodeId == ChatManager.finished) { front = curSection.GetLast(); } else if (saveData.curNodeId == ChatManager.need2Init) { nextReadNode = curRunningNode = curSection.GetFirst(); saveData.curNodeId = curRunningNode.nodeId; saveData.readNodeId = nextReadNode.nodeId; } if (saveData.readNodeId >= 0) { nextReadNode = ChatManager.Instance.LoadSectionByID(curPairID, saveData.readSectionId).nodes [saveData.readNodeId]; } else { //nextReadNode = ChatManager.Instance.LoadSectionByID (curPairID, saveData.curSectionId).GetLast (); } if (front != null) { lastSentence = GetLastSentence(front); } totalRectHeight = saveData.totalRectHeight; }