//a null node public ProgressNode(Vector2 position, float width, float height, GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <ConnectionPoint> OnClickInPoint, Action <ConnectionPoint> OnClickOutPoint, Action <BaseNode> OnClickRemoveNode, Action <BaseNode> OnClickDuplicateNode, int NodeID) : base(position, width, height, nodeStyle, selectedStyle, inPointStyle, outPointStyle, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode, OnClickDuplicateNode) { inPoint = new ProgressionConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint); outPoint = new ProgressionConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint); BranchOutPoint = new ProgressionConnectionPoint(this, ConnectionPointType.Branch, outPointStyle, OnClickOutPoint); TypeOfProgress = ProgressType.None; ID = NodeID; PassID = -1; FailID = -1; TypeID = NodeTypes.ProgressNode; CheckPoint = new ProgressPoint(); Current = false; NoteTitle = ""; Image = null; TaskNumber = 0; NewTaskState = Task.TaskState.Unstarted; BeatName = ""; DreamName = ""; }
public ProgressNode(Vector2 position, float width, float height, GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <ConnectionPoint> OnClickInPoint, Action <ConnectionPoint> OnClickOutPoint, Action <BaseNode> OnClickRemoveNode, Action <BaseNode> OnClickDuplicateNode, JsonData data) : base(position, width, height, nodeStyle, selectedStyle, inPointStyle, outPointStyle, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode, OnClickDuplicateNode) { inPoint = new ProgressionConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint); outPoint = new ProgressionConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint); BranchOutPoint = new ProgressionConnectionPoint(this, ConnectionPointType.Branch, outPointStyle, OnClickOutPoint); if (data.Keys.Contains("color")) { ChangeColor((int)data["color"]); } TypeID = NodeTypes.ProgressNode; if (data.Keys.Contains("TypeOfProgress")) { int ty = (int)data["TypeOfProgress"]; TypeOfProgress = (ProgressType)ty; } else { TypeOfProgress = ProgressType.ProgressPoint; } ID = (int)data["ID"]; PassID = (int)data["PassID"]; FailID = (int)data["FailID"]; title = (string)data["title"]; //CheckToMatch = (string)data["CheckToMatch"]; //MatchValue = (bool)data["MatchValue"]; if (data.Keys.Contains("CheckToMatch")) { CheckPoint = new ProgressPoint(data["CheckToMatch"][0]); } else { CheckPoint = new ProgressPoint(); } if (data.Keys.Contains("Comparison")) { int com = (int)data["Comparison"]; Compare = (ValueCompare)com; } else { Compare = ValueCompare.EqualTo; } if (data.Keys.Contains("Slug") && data["Slug"] != null) { InventoryMatch = Resources.Load("Sprites/" + (string)data["Slug"]) as Texture2D; } if (data.Keys.Contains("NoteTitle")) { NoteTitle = (string)data["NoteTitle"]; } else { NoteTitle = ""; } if (data.Keys.Contains("PhoneImageSlug") && data["PhoneImageSlug"] != null) { Image = Resources.Load <Sprite>("Sprites/" + (string)data["PhoneImageSlug"]); } if (data.Keys.Contains("Current")) { Current = (bool)data["Current"]; } else { Current = false; } if (data.Keys.Contains("TaskNumber")) { TaskNumber = (int)data["TaskNumber"]; } else { TaskNumber = 0; } if (data.Keys.Contains("TaskState")) { int state = (int)data["TaskState"]; NewTaskState = (Task.TaskState)state; } else { NewTaskState = Task.TaskState.Unstarted; } if (data.Keys.Contains("Battery")) { Battery = (int)data["Battery"]; } else { Battery = 0; } if (data.Keys.Contains("Drain")) { Drain = (float)(double)data["Drain"]; } else { Drain = 0; } if (data.Keys.Contains("BeatName")) { BeatName = (string)data["BeatName"]; } else { BeatName = ""; } if (data.Keys.Contains("Previous")) { PreviousScene = (bool)data["Previous"]; } else { PreviousScene = false; } if (data.Keys.Contains("Date")) { int date = (int)data["Date"]; Date = (DayOfWeek)date; } else { Date = DayOfWeek.Monday; } if (data.Keys.Contains("Dream")) { DreamName = (string)data["Dream"]; } else { DreamName = ""; } }