From c7cf18048c9ac5caddff3538512766c91801c738 Mon Sep 17 00:00:00 2001 From: ImAxel0 Date: Sun, 18 Aug 2024 10:11:08 +0200 Subject: [PATCH] 24 new nodes (Rigidbody/SceneManager) --- RedNodeEditor/RedNodeEditor.csproj | 5 ++- RedNodeEditor/Rigidbody/RbGetAngularDrag.cs | 15 +++++++++ .../Rigidbody/RbGetAngularVelocity.cs | 17 ++++++++++ RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs | 17 ++++++++++ RedNodeEditor/Rigidbody/RbGetDrag.cs | 15 +++++++++ RedNodeEditor/Rigidbody/RbGetMass.cs | 15 +++++++++ RedNodeEditor/Rigidbody/RbIsKinematic.cs | 16 ++++++++++ RedNodeEditor/Rigidbody/RbMove.cs | 23 ++++++++++++++ RedNodeEditor/Rigidbody/RbSetAngularDrag.cs | 20 ++++++++++++ .../Rigidbody/RbSetAngularVelocity.cs | 21 +++++++++++++ RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs | 21 +++++++++++++ RedNodeEditor/Rigidbody/RbSetDrag.cs | 20 ++++++++++++ RedNodeEditor/Rigidbody/RbSetMass.cs | 20 ++++++++++++ RedNodeEditor/Rigidbody/RbSetVelocity.cs | 21 +++++++++++++ RedNodeEditor/SceneManager/GetActiveScene.cs | 13 ++++++++ .../SceneManager/GetLoadedSceneCount.cs | 13 ++++++++ RedNodeEditor/SceneManager/GetSceneAt.cs | 16 ++++++++++ RedNodeEditor/SceneManager/GetSceneByName.cs | 16 ++++++++++ RedNodeEditor/SceneManager/GetSceneCount.cs | 13 ++++++++ RedNodeEditor/SceneManager/GetSceneIndex.cs | 16 ++++++++++ RedNodeEditor/SceneManager/GetSceneName.cs | 17 ++++++++++ RedNodeEditor/SceneManager/IsSceneLoaded.cs | 16 ++++++++++ RedNodeEditor/SceneManager/LoadScene.cs | 31 +++++++++++++++++++ RedNodeEditor/SceneManager/LoadSceneAsync.cs | 31 +++++++++++++++++++ .../SceneManager/UnloadSceneAsync.cs | 15 +++++++++ RedNodeLoader/Rigidbody/RbGetAngularDrag.cs | 16 ++++++++++ .../Rigidbody/RbGetAngularVelocity.cs | 18 +++++++++++ RedNodeLoader/Rigidbody/RbGetCenterOfMass.cs | 18 +++++++++++ RedNodeLoader/Rigidbody/RbGetDrag.cs | 16 ++++++++++ RedNodeLoader/Rigidbody/RbGetMass.cs | 16 ++++++++++ RedNodeLoader/Rigidbody/RbIsKinematic.cs | 16 ++++++++++ RedNodeLoader/Rigidbody/RbMove.cs | 23 ++++++++++++++ RedNodeLoader/Rigidbody/RbSetAngularDrag.cs | 18 +++++++++++ .../Rigidbody/RbSetAngularVelocity.cs | 20 ++++++++++++ RedNodeLoader/Rigidbody/RbSetCenterOfMass.cs | 20 ++++++++++++ RedNodeLoader/Rigidbody/RbSetDrag.cs | 18 +++++++++++ RedNodeLoader/Rigidbody/RbSetMass.cs | 18 +++++++++++ RedNodeLoader/Rigidbody/RbSetVelocity.cs | 20 ++++++++++++ RedNodeLoader/SceneManager/GetActiveScene.cs | 16 ++++++++++ .../SceneManager/GetLoadedSceneCount.cs | 12 +++++++ RedNodeLoader/SceneManager/GetSceneAt.cs | 19 ++++++++++++ RedNodeLoader/SceneManager/GetSceneByName.cs | 19 ++++++++++++ RedNodeLoader/SceneManager/GetSceneCount.cs | 12 +++++++ RedNodeLoader/SceneManager/GetSceneIndex.cs | 20 ++++++++++++ RedNodeLoader/SceneManager/GetSceneName.cs | 20 ++++++++++++ RedNodeLoader/SceneManager/IsSceneLoaded.cs | 20 ++++++++++++ RedNodeLoader/SceneManager/LoadScene.cs | 18 +++++++++++ RedNodeLoader/SceneManager/LoadSceneAsync.cs | 18 +++++++++++ .../SceneManager/UnloadSceneAsync.cs | 12 +++++++ 49 files changed, 865 insertions(+), 1 deletion(-) create mode 100644 RedNodeEditor/Rigidbody/RbGetAngularDrag.cs create mode 100644 RedNodeEditor/Rigidbody/RbGetAngularVelocity.cs create mode 100644 RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs create mode 100644 RedNodeEditor/Rigidbody/RbGetDrag.cs create mode 100644 RedNodeEditor/Rigidbody/RbGetMass.cs create mode 100644 RedNodeEditor/Rigidbody/RbIsKinematic.cs create mode 100644 RedNodeEditor/Rigidbody/RbMove.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetAngularDrag.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetAngularVelocity.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetDrag.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetMass.cs create mode 100644 RedNodeEditor/Rigidbody/RbSetVelocity.cs create mode 100644 RedNodeEditor/SceneManager/GetActiveScene.cs create mode 100644 RedNodeEditor/SceneManager/GetLoadedSceneCount.cs create mode 100644 RedNodeEditor/SceneManager/GetSceneAt.cs create mode 100644 RedNodeEditor/SceneManager/GetSceneByName.cs create mode 100644 RedNodeEditor/SceneManager/GetSceneCount.cs create mode 100644 RedNodeEditor/SceneManager/GetSceneIndex.cs create mode 100644 RedNodeEditor/SceneManager/GetSceneName.cs create mode 100644 RedNodeEditor/SceneManager/IsSceneLoaded.cs create mode 100644 RedNodeEditor/SceneManager/LoadScene.cs create mode 100644 RedNodeEditor/SceneManager/LoadSceneAsync.cs create mode 100644 RedNodeEditor/SceneManager/UnloadSceneAsync.cs create mode 100644 RedNodeLoader/Rigidbody/RbGetAngularDrag.cs create mode 100644 RedNodeLoader/Rigidbody/RbGetAngularVelocity.cs create mode 100644 RedNodeLoader/Rigidbody/RbGetCenterOfMass.cs create mode 100644 RedNodeLoader/Rigidbody/RbGetDrag.cs create mode 100644 RedNodeLoader/Rigidbody/RbGetMass.cs create mode 100644 RedNodeLoader/Rigidbody/RbIsKinematic.cs create mode 100644 RedNodeLoader/Rigidbody/RbMove.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetAngularDrag.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetAngularVelocity.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetCenterOfMass.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetDrag.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetMass.cs create mode 100644 RedNodeLoader/Rigidbody/RbSetVelocity.cs create mode 100644 RedNodeLoader/SceneManager/GetActiveScene.cs create mode 100644 RedNodeLoader/SceneManager/GetLoadedSceneCount.cs create mode 100644 RedNodeLoader/SceneManager/GetSceneAt.cs create mode 100644 RedNodeLoader/SceneManager/GetSceneByName.cs create mode 100644 RedNodeLoader/SceneManager/GetSceneCount.cs create mode 100644 RedNodeLoader/SceneManager/GetSceneIndex.cs create mode 100644 RedNodeLoader/SceneManager/GetSceneName.cs create mode 100644 RedNodeLoader/SceneManager/IsSceneLoaded.cs create mode 100644 RedNodeLoader/SceneManager/LoadScene.cs create mode 100644 RedNodeLoader/SceneManager/LoadSceneAsync.cs create mode 100644 RedNodeLoader/SceneManager/UnloadSceneAsync.cs diff --git a/RedNodeEditor/RedNodeEditor.csproj b/RedNodeEditor/RedNodeEditor.csproj index 5e0d6b7..3aab9ec 100644 --- a/RedNodeEditor/RedNodeEditor.csproj +++ b/RedNodeEditor/RedNodeEditor.csproj @@ -1,7 +1,7 @@  - WinExe + Exe net6.0 enable enable @@ -50,6 +50,9 @@ ..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\Game\FMOD.Unity.dll + + ..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\net6\Il2CppInterop.Common.dll + ..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\net6\Il2CppInterop.Runtime.dll diff --git a/RedNodeEditor/Rigidbody/RbGetAngularDrag.cs b/RedNodeEditor/Rigidbody/RbGetAngularDrag.cs new file mode 100644 index 0000000..f59cad7 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbGetAngularDrag.cs @@ -0,0 +1,15 @@ +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbGetAngularDrag : SonsNode +{ + public RbGetAngularDrag() + { + Name = nameof(RbGetAngularDrag); + Description = "Returns the angular drag of the object."; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(float) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbGetAngularVelocity.cs b/RedNodeEditor/Rigidbody/RbGetAngularVelocity.cs new file mode 100644 index 0000000..2fc17fb --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbGetAngularVelocity.cs @@ -0,0 +1,17 @@ +using System.Numerics; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbGetAngularVelocity : SonsNode +{ + public RbGetAngularVelocity() + { + Name = nameof(RbGetAngularVelocity); + Description = "Returns the angular velocity vector of the rigidbody measured in radians per second."; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(Vector3) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs b/RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs new file mode 100644 index 0000000..753c8f2 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs @@ -0,0 +1,17 @@ +using System.Numerics; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbGetCenterOfMass : SonsNode +{ + public RbGetCenterOfMass() + { + Name = nameof(RbGetCenterOfMass); + Description = "Returns the center of mass relative to the transform's origin."; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(Vector3) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbGetDrag.cs b/RedNodeEditor/Rigidbody/RbGetDrag.cs new file mode 100644 index 0000000..d3c5d47 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbGetDrag.cs @@ -0,0 +1,15 @@ +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbGetDrag : SonsNode +{ + public RbGetDrag() + { + Name = nameof(RbGetDrag); + Description = "Returns the drag of the object."; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(float) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbGetMass.cs b/RedNodeEditor/Rigidbody/RbGetMass.cs new file mode 100644 index 0000000..539c479 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbGetMass.cs @@ -0,0 +1,15 @@ +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbGetMass : SonsNode +{ + public RbGetMass() + { + Name = nameof(RbGetMass); + Description = "Returns the mass of the rigidbody."; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(float) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbIsKinematic.cs b/RedNodeEditor/Rigidbody/RbIsKinematic.cs new file mode 100644 index 0000000..aba8703 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbIsKinematic.cs @@ -0,0 +1,16 @@ + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbIsKinematic : SonsNode +{ + public RbIsKinematic() + { + Name = nameof(RbIsKinematic); + Description = "Does physics affects the rigidbody?"; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsOut.Add(new ArgOut { Type = typeof(bool) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbMove.cs b/RedNodeEditor/Rigidbody/RbMove.cs new file mode 100644 index 0000000..90e16a8 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbMove.cs @@ -0,0 +1,23 @@ +using System.Numerics; +using System.Xml.Serialization; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbMove : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Pos { get; set; } + public Vector3 Rot { get; set; } + + public RbMove() + { + Name = nameof(RbMove); + Description = "Moves the Rigidbody to position and rotates the Rigidbody to rotation."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(Vector3), ArgName = nameof(Pos) }); + ArgsIn.Add(new ArgIn { Type = typeof(Vector3), ArgName = nameof(Rot) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetAngularDrag.cs b/RedNodeEditor/Rigidbody/RbSetAngularDrag.cs new file mode 100644 index 0000000..b1b0914 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetAngularDrag.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetAngularDrag : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Drag { get; set; } + + public RbSetAngularDrag() + { + Name = nameof(RbSetAngularDrag); + Description = "Sets the angular drag of the object."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(float), ArgName = nameof(Drag) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetAngularVelocity.cs b/RedNodeEditor/Rigidbody/RbSetAngularVelocity.cs new file mode 100644 index 0000000..f4c26c7 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetAngularVelocity.cs @@ -0,0 +1,21 @@ +using System.Xml.Serialization; +using System.Numerics; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetAngularVelocity : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Velocity { get; set; } + + public RbSetAngularVelocity() + { + Name = nameof(RbSetAngularVelocity); + Description = "Sets the angular velocity vector of the rigidbody measured in radians per second."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(Vector3), ArgName = nameof(Velocity) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs b/RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs new file mode 100644 index 0000000..f5abb6a --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs @@ -0,0 +1,21 @@ +using System.Xml.Serialization; +using System.Numerics; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetCenterOfMass : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Center { get; set; } + + public RbSetCenterOfMass() + { + Name = nameof(RbSetCenterOfMass); + Description = "Sets the center of mass relative to the transform's origin."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(Vector3), ArgName = nameof(Center) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetDrag.cs b/RedNodeEditor/Rigidbody/RbSetDrag.cs new file mode 100644 index 0000000..9f56fc7 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetDrag.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetDrag : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Drag { get; set; } + + public RbSetDrag() + { + Name = nameof(RbSetDrag); + Description = "Sets the drag of the object."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(float), ArgName = nameof(Drag) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetMass.cs b/RedNodeEditor/Rigidbody/RbSetMass.cs new file mode 100644 index 0000000..385075e --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetMass.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetMass : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Mass { get; set; } + + public RbSetMass() + { + Name = nameof(RbSetMass); + Description = "Sets the mass of the rigidbody."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(float), ArgName = nameof(Mass) }); + } +} diff --git a/RedNodeEditor/Rigidbody/RbSetVelocity.cs b/RedNodeEditor/Rigidbody/RbSetVelocity.cs new file mode 100644 index 0000000..7a9ff42 --- /dev/null +++ b/RedNodeEditor/Rigidbody/RbSetVelocity.cs @@ -0,0 +1,21 @@ +using System.Xml.Serialization; +using System.Numerics; + +namespace RedNodeEditor.UnityNodes.Rigidbody; + +public class RbSetVelocity : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Velocity { get; set; } + + public RbSetVelocity() + { + Name = nameof(RbSetVelocity); + Description = "Sets the velocity vector of the rigidbody. It represents the rate of change of Rigidbody position."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(UnityEngine.Rigidbody), ArgName = nameof(Rigidbody) }); + ArgsIn.Add(new ArgIn { Type = typeof(Vector3), ArgName = nameof(Velocity) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetActiveScene.cs b/RedNodeEditor/SceneManager/GetActiveScene.cs new file mode 100644 index 0000000..654970c --- /dev/null +++ b/RedNodeEditor/SceneManager/GetActiveScene.cs @@ -0,0 +1,13 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetActiveScene : SonsNode +{ + public GetActiveScene() + { + Name = nameof(GetActiveScene); + Description = "Gets the currently active Scene."; + NodeCategory = NodeCategories.Unity; + + ArgsOut.Add(new ArgOut { Type = typeof(UnityEngine.SceneManagement.Scene) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetLoadedSceneCount.cs b/RedNodeEditor/SceneManager/GetLoadedSceneCount.cs new file mode 100644 index 0000000..b54ebd2 --- /dev/null +++ b/RedNodeEditor/SceneManager/GetLoadedSceneCount.cs @@ -0,0 +1,13 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetLoadedSceneCount : SonsNode +{ + public GetLoadedSceneCount() + { + Name = nameof(GetLoadedSceneCount); + Description = "Returns the number of loaded Scenes."; + NodeCategory = NodeCategories.Unity; + + ArgsOut.Add(new ArgOut { Type = typeof(int) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetSceneAt.cs b/RedNodeEditor/SceneManager/GetSceneAt.cs new file mode 100644 index 0000000..8a39adc --- /dev/null +++ b/RedNodeEditor/SceneManager/GetSceneAt.cs @@ -0,0 +1,16 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetSceneAt : SonsNode +{ + public int Index { get; set; } + + public GetSceneAt() + { + Name = nameof(GetSceneAt); + Description = "Get the Scene at index in the SceneManager's list of loaded Scenes."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(int), ArgName = nameof(Index) }); + ArgsOut.Add(new ArgOut { Type = typeof(UnityEngine.SceneManagement.Scene) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetSceneByName.cs b/RedNodeEditor/SceneManager/GetSceneByName.cs new file mode 100644 index 0000000..882c1e0 --- /dev/null +++ b/RedNodeEditor/SceneManager/GetSceneByName.cs @@ -0,0 +1,16 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetSceneByName : SonsNode +{ + public string SceneName { get; set; } + + public GetSceneByName() + { + Name = nameof(GetSceneByName); + Description = "Searches through the Scenes loaded for a Scene with the given name."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(string), ArgName = nameof(SceneName) }); + ArgsOut.Add(new ArgOut { Type = typeof(UnityEngine.SceneManagement.Scene) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetSceneCount.cs b/RedNodeEditor/SceneManager/GetSceneCount.cs new file mode 100644 index 0000000..e935deb --- /dev/null +++ b/RedNodeEditor/SceneManager/GetSceneCount.cs @@ -0,0 +1,13 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetSceneCount : SonsNode +{ + public GetSceneCount() + { + Name = nameof(GetSceneCount); + Description = "Returns the current number of Scenes."; + NodeCategory = NodeCategories.Unity; + + ArgsOut.Add(new ArgOut { Type = typeof(int) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetSceneIndex.cs b/RedNodeEditor/SceneManager/GetSceneIndex.cs new file mode 100644 index 0000000..92e8498 --- /dev/null +++ b/RedNodeEditor/SceneManager/GetSceneIndex.cs @@ -0,0 +1,16 @@ +using UnityEngine.SceneManagement; + +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetSceneIndex : SonsNode +{ + public GetSceneIndex() + { + Name = nameof(GetSceneIndex); + Description = "Returns the index of the Scene in the Build Settings."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(Scene), ArgName = nameof(Scene) }); + ArgsOut.Add(new ArgOut { Type = typeof(int) }); + } +} diff --git a/RedNodeEditor/SceneManager/GetSceneName.cs b/RedNodeEditor/SceneManager/GetSceneName.cs new file mode 100644 index 0000000..6c19e60 --- /dev/null +++ b/RedNodeEditor/SceneManager/GetSceneName.cs @@ -0,0 +1,17 @@ +using UnityEngine.SceneManagement; + +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class GetSceneName : SonsNode +{ + public GetSceneName() + { + Name = nameof(GetSceneName); + Description = "Returns the Scene name"; + NodeCategory = NodeCategories.Unity; + SizeOverride = new(250, 120); + + ArgsIn.Add(new ArgIn { Type = typeof(Scene), ArgName = nameof(Scene) }); + ArgsOut.Add(new ArgOut { Type = typeof(string) }); + } +} diff --git a/RedNodeEditor/SceneManager/IsSceneLoaded.cs b/RedNodeEditor/SceneManager/IsSceneLoaded.cs new file mode 100644 index 0000000..7e24b34 --- /dev/null +++ b/RedNodeEditor/SceneManager/IsSceneLoaded.cs @@ -0,0 +1,16 @@ +using UnityEngine.SceneManagement; + +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class IsSceneLoaded : SonsNode +{ + public IsSceneLoaded() + { + Name = nameof(IsSceneLoaded); + Description = "IsLoaded is set to true after loading has completed and objects have been enabled."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(Scene), ArgName = nameof(Scene) }); + ArgsOut.Add(new ArgOut { Type = typeof(bool) }); + } +} diff --git a/RedNodeEditor/SceneManager/LoadScene.cs b/RedNodeEditor/SceneManager/LoadScene.cs new file mode 100644 index 0000000..147f8ca --- /dev/null +++ b/RedNodeEditor/SceneManager/LoadScene.cs @@ -0,0 +1,31 @@ +using RedNodeEditor; +using Newtonsoft.Json; +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class LoadScene : SonsNode +{ + public string SceneName { get; set; } + + [IgnoreProperty] + public LoadSceneMode EnumValue { get; set; } + + [JsonIgnore] + [XmlIgnore] + public List SceneModeEnums { get; set; } = new(); + + public LoadScene() + { + Name = nameof(LoadScene); + Description = "Loads the Scene by its name"; + NodeCategory = NodeCategories.Unity; + + foreach (var key in Enum.GetValues(typeof(LoadSceneMode))) + SceneModeEnums.Add((LoadSceneMode)key); + + ArgsIn.Add(new ArgIn { Type = typeof(string), ArgName = nameof(SceneName) }); + ArgsIn.Add(new ArgIn { Type = typeof(LoadSceneMode), ArgName = nameof(LoadSceneMode) }); + } +} diff --git a/RedNodeEditor/SceneManager/LoadSceneAsync.cs b/RedNodeEditor/SceneManager/LoadSceneAsync.cs new file mode 100644 index 0000000..12551fc --- /dev/null +++ b/RedNodeEditor/SceneManager/LoadSceneAsync.cs @@ -0,0 +1,31 @@ +using RedNodeEditor; +using UnityEngine.SceneManagement; +using Newtonsoft.Json; +using System.Xml.Serialization; + +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class LoadSceneAsync : SonsNode +{ + public string SceneName { get; set; } + + [IgnoreProperty] + public LoadSceneMode EnumValue { get; set; } + + [JsonIgnore] + [XmlIgnore] + public List SceneModeEnums { get; set; } = new(); + + public LoadSceneAsync() + { + Name = nameof(LoadSceneAsync); + Description = "Loads the Scene asynchronously in the background."; + NodeCategory = NodeCategories.Unity; + + foreach (var key in Enum.GetValues(typeof(LoadSceneMode))) + SceneModeEnums.Add((LoadSceneMode)key); + + ArgsIn.Add(new ArgIn { Type = typeof(string), ArgName = nameof(SceneName) }); + ArgsIn.Add(new ArgIn { Type = typeof(LoadSceneMode), ArgName = nameof(LoadSceneMode) }); + } +} diff --git a/RedNodeEditor/SceneManager/UnloadSceneAsync.cs b/RedNodeEditor/SceneManager/UnloadSceneAsync.cs new file mode 100644 index 0000000..8f128e6 --- /dev/null +++ b/RedNodeEditor/SceneManager/UnloadSceneAsync.cs @@ -0,0 +1,15 @@ +namespace RedNodeEditor.UnityNodes.SceneManager; + +public class UnloadSceneAsync : SonsNode +{ + public string SceneName { get; set; } + + public UnloadSceneAsync() + { + Name = nameof(UnloadSceneAsync); + Description = "Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager."; + NodeCategory = NodeCategories.Unity; + + ArgsIn.Add(new ArgIn { Type = typeof(string), ArgName = nameof(SceneName) }); + } +} diff --git a/RedNodeLoader/Rigidbody/RbGetAngularDrag.cs b/RedNodeLoader/Rigidbody/RbGetAngularDrag.cs new file mode 100644 index 0000000..82a3dd2 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbGetAngularDrag.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbGetAngularDrag : SonsNode +{ + [IsArgOut] + public float Drag { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + Drag = rb.angularDrag; + } +} diff --git a/RedNodeLoader/Rigidbody/RbGetAngularVelocity.cs b/RedNodeLoader/Rigidbody/RbGetAngularVelocity.cs new file mode 100644 index 0000000..cdd096e --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbGetAngularVelocity.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Numerics; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbGetAngularVelocity : SonsNode +{ + [IsArgOut] + public Vector3 Velocity { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var v3 = new Vector3(rb.angularVelocity.x, rb.angularVelocity.y, rb.angularVelocity.z); + Velocity = v3; + } +} diff --git a/RedNodeLoader/Rigidbody/RbGetCenterOfMass.cs b/RedNodeLoader/Rigidbody/RbGetCenterOfMass.cs new file mode 100644 index 0000000..5f90317 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbGetCenterOfMass.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Numerics; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbGetCenterOfMass : SonsNode +{ + [IsArgOut] + public Vector3 Center { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var v3 = new Vector3(rb.centerOfMass.x, rb.centerOfMass.y, rb.centerOfMass.z); + Center = v3; + } +} diff --git a/RedNodeLoader/Rigidbody/RbGetDrag.cs b/RedNodeLoader/Rigidbody/RbGetDrag.cs new file mode 100644 index 0000000..07c0c8b --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbGetDrag.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbGetDrag : SonsNode +{ + [IsArgOut] + public float Drag { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + Drag = rb.drag; + } +} diff --git a/RedNodeLoader/Rigidbody/RbGetMass.cs b/RedNodeLoader/Rigidbody/RbGetMass.cs new file mode 100644 index 0000000..4b75c93 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbGetMass.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbGetMass : SonsNode +{ + [IsArgOut] + public float Mass { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + Mass = rb.mass; + } +} diff --git a/RedNodeLoader/Rigidbody/RbIsKinematic.cs b/RedNodeLoader/Rigidbody/RbIsKinematic.cs new file mode 100644 index 0000000..90a4970 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbIsKinematic.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbIsKinematic : SonsNode +{ + [IsArgOut] + public bool IsKinematic { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + IsKinematic = rb.isKinematic; + } +} diff --git a/RedNodeLoader/Rigidbody/RbMove.cs b/RedNodeLoader/Rigidbody/RbMove.cs new file mode 100644 index 0000000..090113f --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbMove.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using System.Numerics; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbMove : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Pos { get; set; } + public Vector3 Rot { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var pos = (Vector3)args[1]; + var rot = (Vector3)args[2]; + rb.Move(new UnityEngine.Vector3(pos.X, pos.Y, pos.Z), + UnityEngine.Quaternion.Euler(new UnityEngine.Vector3(rot.X, rot.Y, rot.Z))); + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetAngularDrag.cs b/RedNodeLoader/Rigidbody/RbSetAngularDrag.cs new file mode 100644 index 0000000..3c5e83d --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetAngularDrag.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetAngularDrag : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Drag { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + rb.angularDrag = (float)args[1]; + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetAngularVelocity.cs b/RedNodeLoader/Rigidbody/RbSetAngularVelocity.cs new file mode 100644 index 0000000..f454626 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetAngularVelocity.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Numerics; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetAngularVelocity : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Velocity { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var v3 = (Vector3)args[1]; + rb.angularVelocity = new UnityEngine.Vector3(v3.X, v3.Y, v3.Z); + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetCenterOfMass.cs b/RedNodeLoader/Rigidbody/RbSetCenterOfMass.cs new file mode 100644 index 0000000..281b18c --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetCenterOfMass.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Numerics; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetCenterOfMass : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Velocity { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var v3 = (Vector3)args[1]; + rb.centerOfMass = new UnityEngine.Vector3(v3.X, v3.Y, v3.Z); + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetDrag.cs b/RedNodeLoader/Rigidbody/RbSetDrag.cs new file mode 100644 index 0000000..52b05f9 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetDrag.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetDrag : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Drag { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + rb.drag = (float)args[1]; + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetMass.cs b/RedNodeLoader/Rigidbody/RbSetMass.cs new file mode 100644 index 0000000..fe89bfe --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetMass.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetMass : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public float Mass { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + rb.mass = (float)args[1]; + } +} diff --git a/RedNodeLoader/Rigidbody/RbSetVelocity.cs b/RedNodeLoader/Rigidbody/RbSetVelocity.cs new file mode 100644 index 0000000..ece0882 --- /dev/null +++ b/RedNodeLoader/Rigidbody/RbSetVelocity.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Numerics; +using System.Xml.Serialization; + +namespace RedNodeLoader.UnityNodes.Rigidbody; + +public class RbSetVelocity : SonsNode +{ + [XmlIgnore] + public UnityEngine.Rigidbody Rigidbody { get; set; } + public Vector3 Velocity { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var rb = (UnityEngine.Rigidbody)args[0]; + var v3 = (Vector3)args[1]; + rb.velocity = new UnityEngine.Vector3(v3.X, v3.Y, v3.Z); + } +} diff --git a/RedNodeLoader/SceneManager/GetActiveScene.cs b/RedNodeLoader/SceneManager/GetActiveScene.cs new file mode 100644 index 0000000..8a3d1af --- /dev/null +++ b/RedNodeLoader/SceneManager/GetActiveScene.cs @@ -0,0 +1,16 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetActiveScene : SonsNode +{ + [XmlIgnore] + [IsArgOut] + public Scene Scene { get; set; } + + public override void Execute() + { + Scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); + } +} diff --git a/RedNodeLoader/SceneManager/GetLoadedSceneCount.cs b/RedNodeLoader/SceneManager/GetLoadedSceneCount.cs new file mode 100644 index 0000000..bddb9c8 --- /dev/null +++ b/RedNodeLoader/SceneManager/GetLoadedSceneCount.cs @@ -0,0 +1,12 @@ +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetLoadedSceneCount : SonsNode +{ + [IsArgOut] + public int SceneCount { get; set; } + + public override void Execute() + { + SceneCount = UnityEngine.SceneManagement.SceneManager.loadedSceneCount; + } +} diff --git a/RedNodeLoader/SceneManager/GetSceneAt.cs b/RedNodeLoader/SceneManager/GetSceneAt.cs new file mode 100644 index 0000000..a355a35 --- /dev/null +++ b/RedNodeLoader/SceneManager/GetSceneAt.cs @@ -0,0 +1,19 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetSceneAt : SonsNode +{ + public int Index { get; set; } + + [XmlIgnore] + [IsArgOut] + public Scene Scene { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + Scene = UnityEngine.SceneManagement.SceneManager.GetSceneAt((int)args[0]); + } +} diff --git a/RedNodeLoader/SceneManager/GetSceneByName.cs b/RedNodeLoader/SceneManager/GetSceneByName.cs new file mode 100644 index 0000000..b87b2da --- /dev/null +++ b/RedNodeLoader/SceneManager/GetSceneByName.cs @@ -0,0 +1,19 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetSceneByName : SonsNode +{ + public string Scenename { get; set; } + + [XmlIgnore] + [IsArgOut] + public Scene Scene { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + Scene = UnityEngine.SceneManagement.SceneManager.GetSceneByName((string)args[0]); + } +} diff --git a/RedNodeLoader/SceneManager/GetSceneCount.cs b/RedNodeLoader/SceneManager/GetSceneCount.cs new file mode 100644 index 0000000..0ee2fc0 --- /dev/null +++ b/RedNodeLoader/SceneManager/GetSceneCount.cs @@ -0,0 +1,12 @@ +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetSceneCount : SonsNode +{ + [IsArgOut] + public int SceneCount { get; set; } + + public override void Execute() + { + SceneCount = UnityEngine.SceneManagement.SceneManager.sceneCount; + } +} diff --git a/RedNodeLoader/SceneManager/GetSceneIndex.cs b/RedNodeLoader/SceneManager/GetSceneIndex.cs new file mode 100644 index 0000000..eb4e549 --- /dev/null +++ b/RedNodeLoader/SceneManager/GetSceneIndex.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetSceneIndex : SonsNode +{ + [XmlIgnore] + public Scene Scene { get; set; } + + [IsArgOut] + public int SceneIndex { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var scene = (Scene)args[0]; + SceneIndex = scene.buildIndex; + } +} diff --git a/RedNodeLoader/SceneManager/GetSceneName.cs b/RedNodeLoader/SceneManager/GetSceneName.cs new file mode 100644 index 0000000..9045846 --- /dev/null +++ b/RedNodeLoader/SceneManager/GetSceneName.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class GetSceneName : SonsNode +{ + [XmlIgnore] + public Scene Scene { get; set; } + + [IsArgOut] + public string SceneName { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var scene = (Scene)args[0]; + SceneName = scene.name; + } +} diff --git a/RedNodeLoader/SceneManager/IsSceneLoaded.cs b/RedNodeLoader/SceneManager/IsSceneLoaded.cs new file mode 100644 index 0000000..b69c441 --- /dev/null +++ b/RedNodeLoader/SceneManager/IsSceneLoaded.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class IsSceneLoaded : SonsNode +{ + [XmlIgnore] + public Scene Scene { get; set; } + + [IsArgOut] + public bool IsLoaded { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + var scene = (Scene)args[0]; + IsLoaded = scene.isLoaded; + } +} diff --git a/RedNodeLoader/SceneManager/LoadScene.cs b/RedNodeLoader/SceneManager/LoadScene.cs new file mode 100644 index 0000000..3ad0ad1 --- /dev/null +++ b/RedNodeLoader/SceneManager/LoadScene.cs @@ -0,0 +1,18 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class LoadScene : SonsNode +{ + public string SceneName { get; set; } + + [XmlIgnore] + public LoadSceneMode EnumValue { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + UnityEngine.SceneManagement.SceneManager.LoadScene((string)args[0], (LoadSceneMode)args[1]); + } +} diff --git a/RedNodeLoader/SceneManager/LoadSceneAsync.cs b/RedNodeLoader/SceneManager/LoadSceneAsync.cs new file mode 100644 index 0000000..19c6b4d --- /dev/null +++ b/RedNodeLoader/SceneManager/LoadSceneAsync.cs @@ -0,0 +1,18 @@ +using System.Xml.Serialization; +using UnityEngine.SceneManagement; + +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class LoadSceneAsync : SonsNode +{ + public string SceneName { get; set; } + + [XmlIgnore] + public LoadSceneMode EnumValue { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + UnityEngine.SceneManagement.SceneManager.LoadSceneAsync((string)args[0], (LoadSceneMode)args[1]); + } +} diff --git a/RedNodeLoader/SceneManager/UnloadSceneAsync.cs b/RedNodeLoader/SceneManager/UnloadSceneAsync.cs new file mode 100644 index 0000000..61ff582 --- /dev/null +++ b/RedNodeLoader/SceneManager/UnloadSceneAsync.cs @@ -0,0 +1,12 @@ +namespace RedNodeLoader.UnityNodes.SceneManager; + +public class UnloadSceneAsync : SonsNode +{ + public string SceneName { get; set; } + + public override void Execute() + { + List args = RedNodeLoader.GetArgumentsOf(this); + UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync((string)args[0]); + } +}