Skip to content

Commit

Permalink
24 new nodes (Rigidbody/SceneManager)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImAxel0 committed Aug 18, 2024
1 parent 3bc88db commit c7cf180
Show file tree
Hide file tree
Showing 49 changed files with 865 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RedNodeEditor/RedNodeEditor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -50,6 +50,9 @@
<Reference Include="FMOD.Unity">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\Game\FMOD.Unity.dll</HintPath>
</Reference>
<Reference Include="Il2CppInterop.Common">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\net6\Il2CppInterop.Common.dll</HintPath>
</Reference>
<Reference Include="Il2CppInterop.Runtime">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Sons Of The Forest\_RedLoader\net6\Il2CppInterop.Runtime.dll</HintPath>
</Reference>
Expand Down
15 changes: 15 additions & 0 deletions RedNodeEditor/Rigidbody/RbGetAngularDrag.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
17 changes: 17 additions & 0 deletions RedNodeEditor/Rigidbody/RbGetAngularVelocity.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
17 changes: 17 additions & 0 deletions RedNodeEditor/Rigidbody/RbGetCenterOfMass.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
15 changes: 15 additions & 0 deletions RedNodeEditor/Rigidbody/RbGetDrag.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
15 changes: 15 additions & 0 deletions RedNodeEditor/Rigidbody/RbGetMass.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
16 changes: 16 additions & 0 deletions RedNodeEditor/Rigidbody/RbIsKinematic.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
23 changes: 23 additions & 0 deletions RedNodeEditor/Rigidbody/RbMove.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
20 changes: 20 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetAngularDrag.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
21 changes: 21 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetAngularVelocity.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
21 changes: 21 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetCenterOfMass.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
20 changes: 20 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetDrag.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
20 changes: 20 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetMass.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
21 changes: 21 additions & 0 deletions RedNodeEditor/Rigidbody/RbSetVelocity.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
13 changes: 13 additions & 0 deletions RedNodeEditor/SceneManager/GetActiveScene.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
13 changes: 13 additions & 0 deletions RedNodeEditor/SceneManager/GetLoadedSceneCount.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
16 changes: 16 additions & 0 deletions RedNodeEditor/SceneManager/GetSceneAt.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
16 changes: 16 additions & 0 deletions RedNodeEditor/SceneManager/GetSceneByName.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
13 changes: 13 additions & 0 deletions RedNodeEditor/SceneManager/GetSceneCount.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
16 changes: 16 additions & 0 deletions RedNodeEditor/SceneManager/GetSceneIndex.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
17 changes: 17 additions & 0 deletions RedNodeEditor/SceneManager/GetSceneName.cs
Original file line number Diff line number Diff line change
@@ -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) });
}
}
Loading

0 comments on commit c7cf180

Please sign in to comment.