From 3e50508adf227e03a7bab3b28e50090c59cdbeb9 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Mon, 14 Dec 2020 12:38:35 +0100 Subject: [PATCH] Add Android to Platform Switch node --- Source/Editor/Surface/Archetypes/Tools.cs | 5 +++-- Source/Engine/Visject/ShaderGraph.cpp | 1 + Source/Engine/Visject/VisjectGraph.cpp | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Surface/Archetypes/Tools.cs b/Source/Editor/Surface/Archetypes/Tools.cs index d7d1ca9e1..3a988ad9b 100644 --- a/Source/Editor/Surface/Archetypes/Tools.cs +++ b/Source/Editor/Surface/Archetypes/Tools.cs @@ -1229,9 +1229,9 @@ namespace FlaxEditor.Surface.Archetypes Title = "Platform Switch", Description = "Gets the input value based on the runtime-platform type", Flags = NodeFlags.AllGraphs, - Size = new Vector2(220, 150), + Size = new Vector2(220, 160), ConnectionsHints = ConnectionsHint.Value, - IndependentBoxes = new[] { 1, 2, 3, 4, 5, 6, 7 }, + IndependentBoxes = new[] { 1, 2, 3, 4, 5, 6, 7, 8 }, DependentBoxes = new[] { 0 }, Elements = new[] { @@ -1243,6 +1243,7 @@ namespace FlaxEditor.Surface.Archetypes NodeElementArchetype.Factory.Input(4, "Linux", true, null, 5), NodeElementArchetype.Factory.Input(5, "PlayStation 4", true, null, 6), NodeElementArchetype.Factory.Input(6, "Xbox Scarlett", true, null, 7), + NodeElementArchetype.Factory.Input(7, "Android", true, null, 8), } }, new NodeArchetype diff --git a/Source/Engine/Visject/ShaderGraph.cpp b/Source/Engine/Visject/ShaderGraph.cpp index 5536f4b39..452006996 100644 --- a/Source/Engine/Visject/ShaderGraph.cpp +++ b/Source/Engine/Visject/ShaderGraph.cpp @@ -739,6 +739,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) PLATFORM_CASE(5, "PLATFORM_LINUX"); PLATFORM_CASE(6, "PLATFORM_PS4"); PLATFORM_CASE(7, "PLATFORM_XBOX_SCARLETT"); + PLATFORM_CASE(8, "PLATFORM_ANDROID"); #undef PLATFORM_CASE break; } diff --git a/Source/Engine/Visject/VisjectGraph.cpp b/Source/Engine/Visject/VisjectGraph.cpp index 9edc7a2a3..8f2766a0a 100644 --- a/Source/Engine/Visject/VisjectGraph.cpp +++ b/Source/Engine/Visject/VisjectGraph.cpp @@ -690,6 +690,9 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) case PlatformType::XboxScarlett: boxId = 7; break; + case PlatformType::Android: + boxId = 8; + break; default: ; } value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero);