From 04b8266c085e57d3c7356af6d13d42f3e4836848 Mon Sep 17 00:00:00 2001 From: Josef Date: Fri, 28 Nov 2025 15:24:23 +0100 Subject: [PATCH] Game Obejct Updates --- Icons/GameObject3D.svg | 173 ++++++++++++++++++ Icons/GameObject3D.svg.import | 43 +++++ Runtime/Actions/Node3D/CopyPositionXZ.cs | 48 +++++ Runtime/Actions/Node3D/CopyPositionXZ.cs.uid | 1 + .../AnimationTree/SetAnimationTreeBool.cs | 28 +++ .../AnimationTree/SetAnimationTreeBool.cs.uid | 1 + Runtime/App/Main.cs.uid | 1 + Runtime/Cameras/SetCameraFarDOF.cs | 31 ++++ Runtime/Cameras/SetCameraFarDOF.cs.uid | 1 + Runtime/GameObjects/GameObject3D.cs | 70 +++++++ Runtime/GameObjects/GameObject3D.cs.uid | 1 + .../CharacterController/CharacterMovement.cs | 1 + Runtime/Networking/Nodes/NetworkNodeMember.cs | 2 +- 13 files changed, 400 insertions(+), 1 deletion(-) create mode 100644 Icons/GameObject3D.svg create mode 100644 Icons/GameObject3D.svg.import create mode 100644 Runtime/Actions/Node3D/CopyPositionXZ.cs create mode 100644 Runtime/Actions/Node3D/CopyPositionXZ.cs.uid create mode 100644 Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs create mode 100644 Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs.uid create mode 100644 Runtime/App/Main.cs.uid create mode 100644 Runtime/Cameras/SetCameraFarDOF.cs create mode 100644 Runtime/Cameras/SetCameraFarDOF.cs.uid create mode 100644 Runtime/GameObjects/GameObject3D.cs create mode 100644 Runtime/GameObjects/GameObject3D.cs.uid diff --git a/Icons/GameObject3D.svg b/Icons/GameObject3D.svg new file mode 100644 index 0000000..81b458c --- /dev/null +++ b/Icons/GameObject3D.svg @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Icons/GameObject3D.svg.import b/Icons/GameObject3D.svg.import new file mode 100644 index 0000000..df654f0 --- /dev/null +++ b/Icons/GameObject3D.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://leik73nsrbxt" +path="res://.godot/imported/GameObject3D.svg-ab4e7400f730b9a29ca53b7cb9fbc54c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/rokojori_action_library/Icons/GameObject3D.svg" +dest_files=["res://.godot/imported/GameObject3D.svg-ab4e7400f730b9a29ca53b7cb9fbc54c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Runtime/Actions/Node3D/CopyPositionXZ.cs b/Runtime/Actions/Node3D/CopyPositionXZ.cs new file mode 100644 index 0000000..fcc073c --- /dev/null +++ b/Runtime/Actions/Node3D/CopyPositionXZ.cs @@ -0,0 +1,48 @@ + +using Godot; + + +namespace Rokojori +{ + [GlobalClass, Tool ] + public partial class CopyPositionXZ : Action + { + [Export] + public Node3D source; + + [Export] + public Node3D target; + + [Export] + public Vector3 offset = Vector3.Zero; + + [Export] + public bool global = true; + + protected override void _OnTrigger() + { + if ( source == null || target == null ) + { + return; + } + + if ( global ) + { + var y = target.GlobalPosition.Y; + var position = source.GlobalPosition + offset; + position.Y = y; + target.GlobalPosition = position; + } + else + { + var y = target.Position.Y; + var position = source.Position + offset; + position.Y = y; + + target.Position = position; + } + + + } + } +} \ No newline at end of file diff --git a/Runtime/Actions/Node3D/CopyPositionXZ.cs.uid b/Runtime/Actions/Node3D/CopyPositionXZ.cs.uid new file mode 100644 index 0000000..f7c19dd --- /dev/null +++ b/Runtime/Actions/Node3D/CopyPositionXZ.cs.uid @@ -0,0 +1 @@ +uid://cvpseyll6lrh5 diff --git a/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs b/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs new file mode 100644 index 0000000..8e8e81d --- /dev/null +++ b/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Text; +using Godot; + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class SetAnimationTreeBool:Action + { + [Export] + public AnimationTree tree; + + [Export] + public string name; + + [Export] + public bool value; + + protected override void _OnTrigger() + { + tree.Set( "parameters/conditions/" + name, value ); + tree.Set( "parameters/conditions/not_" + name, ! value ); + } + } +} \ No newline at end of file diff --git a/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs.uid b/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs.uid new file mode 100644 index 0000000..4f8455e --- /dev/null +++ b/Runtime/Animation/AnimationTree/SetAnimationTreeBool.cs.uid @@ -0,0 +1 @@ +uid://dykyfwv0qjcbn diff --git a/Runtime/App/Main.cs.uid b/Runtime/App/Main.cs.uid new file mode 100644 index 0000000..03cb68d --- /dev/null +++ b/Runtime/App/Main.cs.uid @@ -0,0 +1 @@ +uid://dedtmhyfax8p0 diff --git a/Runtime/Cameras/SetCameraFarDOF.cs b/Runtime/Cameras/SetCameraFarDOF.cs new file mode 100644 index 0000000..20f700d --- /dev/null +++ b/Runtime/Cameras/SetCameraFarDOF.cs @@ -0,0 +1,31 @@ + +using System; +using Godot; + + +namespace Rokojori +{ + [Tool] + [GlobalClass] + public partial class SetCameraFarDOF:Action + { + [Export] + public WorldEnvironment worldEnvironment; + + [Export] + public bool dofBlurFarEnabled = true; + + protected override void _OnTrigger() + { + var atts = worldEnvironment.CameraAttributes as CameraAttributesPractical; + + if ( atts == null ) + { + return; + } + + atts.DofBlurFarEnabled = dofBlurFarEnabled; + + } + } +} \ No newline at end of file diff --git a/Runtime/Cameras/SetCameraFarDOF.cs.uid b/Runtime/Cameras/SetCameraFarDOF.cs.uid new file mode 100644 index 0000000..d6744e3 --- /dev/null +++ b/Runtime/Cameras/SetCameraFarDOF.cs.uid @@ -0,0 +1 @@ +uid://o1xll543uue3 diff --git a/Runtime/GameObjects/GameObject3D.cs b/Runtime/GameObjects/GameObject3D.cs new file mode 100644 index 0000000..d37b7ff --- /dev/null +++ b/Runtime/GameObjects/GameObject3D.cs @@ -0,0 +1,70 @@ + +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using System; +using Godot; +using System.Linq; + + +namespace Rokojori +{ + [Tool] + [GlobalClass, Icon("res://addons/rokojori_action_library/Icons/GameObject3D.svg") ] + public partial class GameObject3D:Node3D, INetworkNode + { + [ExportGroup("Physics")] + [Export] + public PhysicsBody3D body; + + [Export] + public Node3D origin; + + [ExportCategory("Networking")] + [ExportGroup("Network Settings")] + [Export] + public NetworkTransportType networkType = NetworkTransportType.Never_Networked; + public NetworkTransportType GetNetworkType(){ return networkType; } + + [Export] + public int networkOwner; + public int GetNetworkOwner(){ return networkOwner; } + + + protected List _networkNodeMembers = null; + protected NetworkNodeSlot _networkNodeSlot = new NetworkNodeSlot(); + + public virtual List GetNetworkNodeMembers() + { + if ( _networkNodeMembers != null ) + { + return _networkNodeMembers; + } + + _networkNodeMembers = CreateNetworkNodeMembers(); + _networkNodeSlot.onMessage.AddAction( _OnNetworkMessageReceived ); + + InitializeNetworkMembers(); + + return _networkNodeMembers; + } + + protected virtual List CreateNetworkNodeMembers() + { + return new List(){ _networkNodeSlot }; + } + + protected virtual void InitializeNetworkMembers() + { + for ( int i = 0; i < _networkNodeMembers.Count; i++ ) + { + _networkNodeMembers[ i ]._SetNode( this ); + } + } + + protected virtual void _OnNetworkMessageReceived( NetworkMessageEvent m ) + { + + } + } +} \ No newline at end of file diff --git a/Runtime/GameObjects/GameObject3D.cs.uid b/Runtime/GameObjects/GameObject3D.cs.uid new file mode 100644 index 0000000..ac47059 --- /dev/null +++ b/Runtime/GameObjects/GameObject3D.cs.uid @@ -0,0 +1 @@ +uid://bq56bfytlbxq7 diff --git a/Runtime/Interactions/CharacterController/CharacterMovement.cs b/Runtime/Interactions/CharacterController/CharacterMovement.cs index bf5edca..62bf33c 100644 --- a/Runtime/Interactions/CharacterController/CharacterMovement.cs +++ b/Runtime/Interactions/CharacterController/CharacterMovement.cs @@ -37,6 +37,7 @@ namespace Rokojori [Export] public float minSpeed = 0f; + [Export] public CharacterMovementType controllerMovementType; diff --git a/Runtime/Networking/Nodes/NetworkNodeMember.cs b/Runtime/Networking/Nodes/NetworkNodeMember.cs index f11e430..686245a 100644 --- a/Runtime/Networking/Nodes/NetworkNodeMember.cs +++ b/Runtime/Networking/Nodes/NetworkNodeMember.cs @@ -49,7 +49,7 @@ namespace Rokojori return NetworkTransportSettings.CanSend( networkType, networkNode.GetNetworkOwner() ); } - public void _SetNode( NetworkNode node ) + public void _SetNode( INetworkNode node ) { _networkNode = node; }