diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 1ebd330..2786c87 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -31,7 +31,12 @@ } else if (saveNode.type == "exit") { node = new ExitNode(saveNode.position, roads, config).init(); } else { - node = new CustomNode(saveNode.position, roads, config).init(); + CustomNode customNode = new CustomNode(saveNode.position, roads, config); + customNode.lightPhase = saveNode.lightPhase; + if (customNode.lightPhase != 0) { + customNode.isPassable = false; + } + node = customNode.init(); } nodes.Add(node); } diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 1ebd330..2786c87 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -31,7 +31,12 @@ } else if (saveNode.type == "exit") { node = new ExitNode(saveNode.position, roads, config).init(); } else { - node = new CustomNode(saveNode.position, roads, config).init(); + CustomNode customNode = new CustomNode(saveNode.position, roads, config); + customNode.lightPhase = saveNode.lightPhase; + if (customNode.lightPhase != 0) { + customNode.isPassable = false; + } + node = customNode.init(); } nodes.Add(node); } diff --git a/Assets/Scripts/Buttons/SaveButton.cs b/Assets/Scripts/Buttons/SaveButton.cs index a8865b5..0d68921 100644 --- a/Assets/Scripts/Buttons/SaveButton.cs +++ b/Assets/Scripts/Buttons/SaveButton.cs @@ -29,6 +29,8 @@ } else { saveNode.type = ""; saveNode.targets = new List(); + CustomNode customNode = (CustomNode) node; + saveNode.lightPhase = customNode.lightPhase; } nodes.Add(saveNode); } diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 1ebd330..2786c87 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -31,7 +31,12 @@ } else if (saveNode.type == "exit") { node = new ExitNode(saveNode.position, roads, config).init(); } else { - node = new CustomNode(saveNode.position, roads, config).init(); + CustomNode customNode = new CustomNode(saveNode.position, roads, config); + customNode.lightPhase = saveNode.lightPhase; + if (customNode.lightPhase != 0) { + customNode.isPassable = false; + } + node = customNode.init(); } nodes.Add(node); } diff --git a/Assets/Scripts/Buttons/SaveButton.cs b/Assets/Scripts/Buttons/SaveButton.cs index a8865b5..0d68921 100644 --- a/Assets/Scripts/Buttons/SaveButton.cs +++ b/Assets/Scripts/Buttons/SaveButton.cs @@ -29,6 +29,8 @@ } else { saveNode.type = ""; saveNode.targets = new List(); + CustomNode customNode = (CustomNode) node; + saveNode.lightPhase = customNode.lightPhase; } nodes.Add(saveNode); } diff --git a/Assets/Scripts/Buttons/SaveStructs.cs b/Assets/Scripts/Buttons/SaveStructs.cs index 6a0bc86..c51c3af 100644 --- a/Assets/Scripts/Buttons/SaveStructs.cs +++ b/Assets/Scripts/Buttons/SaveStructs.cs @@ -8,6 +8,7 @@ public Vector3 position; public string type; public List targets; + public int lightPhase; } [Serializable]