DomeFox Updates
This commit is contained in:
parent
1c98676862
commit
cc090bdf47
|
|
@ -161,7 +161,7 @@ namespace Rokojori
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RJLog.Log( "Triggering Action", actions[ i ].Name );
|
// RJLog.Log( _runID, "Triggering Actions Before", i, actions[ i ].Name, HierarchyName.Of( action ) );
|
||||||
|
|
||||||
Action.Trigger( actions[ i ] );
|
Action.Trigger( actions[ i ] );
|
||||||
}
|
}
|
||||||
|
|
@ -210,6 +210,8 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this.LogInfo( "Running" );
|
||||||
|
|
||||||
var run = new ActionSequenceRunner();
|
var run = new ActionSequenceRunner();
|
||||||
run.sequence = this;
|
run.sequence = this;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ namespace Rokojori
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
p.Restart();
|
p.Restart();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int IndexOf( GpuParticles3D p )
|
public int IndexOf( GpuParticles3D p )
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public bool queue = true;
|
public bool queue = true;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool disableAllNodes = true;
|
||||||
|
|
||||||
|
|
||||||
protected override void _OnTrigger()
|
protected override void _OnTrigger()
|
||||||
{
|
{
|
||||||
|
|
@ -37,6 +40,12 @@ namespace Rokojori
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( disableAllNodes )
|
||||||
|
{
|
||||||
|
target.ForEach<Node>( n => NodeState.Disable( n ) );
|
||||||
|
NodeState.Disable( target );
|
||||||
|
}
|
||||||
|
|
||||||
target.SelfDestroy( queue );
|
target.SelfDestroy( queue );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ namespace Rokojori
|
||||||
|
|
||||||
protected override void _OnTrigger()
|
protected override void _OnTrigger()
|
||||||
{
|
{
|
||||||
if ( Engine.IsEditorHint() )
|
// if ( Engine.IsEditorHint() )
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ( particles3D == null )
|
if ( particles3D == null )
|
||||||
{
|
{
|
||||||
|
|
@ -73,7 +73,8 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
DispatchEnd( sequenceID );
|
DispatchEnd( sequenceID );
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
this
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,7 @@ point_count = 3
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_jwnpm"]
|
[sub_resource type="Resource" id="Resource_jwnpm"]
|
||||||
script = ExtResource("2_g6huw")
|
script = ExtResource("2_g6huw")
|
||||||
duration = 1.0
|
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_j2uji")
|
curve = SubResource("Curve_j2uji")
|
||||||
scaleY = 1.0
|
|
||||||
scaleRandomRange = 0.0
|
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_c1l7g"]
|
[sub_resource type="Curve" id="Curve_c1l7g"]
|
||||||
_limits = [-1.0, 1.0, 0.0, 1.0]
|
_limits = [-1.0, 1.0, 0.0, 1.0]
|
||||||
|
|
@ -25,25 +19,17 @@ point_count = 2
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qub8t"]
|
[sub_resource type="Resource" id="Resource_qub8t"]
|
||||||
script = ExtResource("2_g6huw")
|
script = ExtResource("2_g6huw")
|
||||||
duration = 1.0
|
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_c1l7g")
|
curve = SubResource("Curve_c1l7g")
|
||||||
scaleY = 30.0
|
scaleY = 30.0
|
||||||
scaleRandomRange = 0.0
|
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_gbi52")
|
script = ExtResource("1_gbi52")
|
||||||
shakeAmountCurve = SubResource("Resource_jwnpm")
|
shakeAmountCurve = SubResource("Resource_jwnpm")
|
||||||
shakeChangeFPSCurve = SubResource("Resource_qub8t")
|
shakeChangeFPSCurve = SubResource("Resource_qub8t")
|
||||||
timeline = ExtResource("3_pgufg")
|
timeline = ExtResource("3_pgufg")
|
||||||
smooth = true
|
|
||||||
smoothingStrength = 0.477
|
smoothingStrength = 0.477
|
||||||
positionShake = Vector3(0.075, 0, 0.075)
|
positionShake = Vector3(0.075, 0, 0.075)
|
||||||
globalPosition = false
|
globalPosition = false
|
||||||
repeatAndFlipFirstPosition = true
|
|
||||||
rotationShake = Vector3(0.5, 0.5, 10)
|
rotationShake = Vector3(0.5, 0.5, 10)
|
||||||
globalRotation = false
|
globalRotation = false
|
||||||
scaleShake = Vector3(0.1, 0.1, 0.1)
|
scaleShake = Vector3(0.1, 0.1, 0.1)
|
||||||
scaleShakeIsRelative = true
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Text;
|
||||||
|
|
||||||
namespace Rokojori
|
namespace Rokojori
|
||||||
{
|
{
|
||||||
[GlobalClass,Tool, Icon("res://addons/rokojori_action_library/Icons/SelecorFlag.svg") ]
|
[GlobalClass,Tool]
|
||||||
public partial class AudioFlag:SelectorFlag
|
public partial class AudioFlag:SelectorFlag
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="CameraEffect" load_steps=8 format=3 uid="uid://ds6sptirfbytc"]
|
[gd_resource type="Resource" script_class="CameraEffect" load_steps=8 format=3 uid="uid://ds6sptirfbytc"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_m7t4k"]
|
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_m7t4k"]
|
||||||
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffect.cs" id="2_ahqbp"]
|
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffect.cs" id="2_ahqbp"]
|
||||||
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_iffro"]
|
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_iffro"]
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_62jxv"]
|
[sub_resource type="Curve" id="Curve_62jxv"]
|
||||||
|
|
@ -11,12 +11,8 @@ point_count = 8
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_esvga"]
|
[sub_resource type="Resource" id="Resource_esvga"]
|
||||||
script = ExtResource("1_m7t4k")
|
script = ExtResource("1_m7t4k")
|
||||||
target = 0
|
|
||||||
flipScaleYRandomly = true
|
flipScaleYRandomly = true
|
||||||
duration = 0.5
|
duration = 0.5
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_62jxv")
|
curve = SubResource("Curve_62jxv")
|
||||||
scaleY = 0.05
|
scaleY = 0.05
|
||||||
scaleRandomRange = 0.1
|
scaleRandomRange = 0.1
|
||||||
|
|
@ -29,11 +25,7 @@ point_count = 9
|
||||||
[sub_resource type="Resource" id="Resource_s8na2"]
|
[sub_resource type="Resource" id="Resource_s8na2"]
|
||||||
script = ExtResource("1_m7t4k")
|
script = ExtResource("1_m7t4k")
|
||||||
target = 1
|
target = 1
|
||||||
flipScaleYRandomly = false
|
|
||||||
duration = 0.5
|
duration = 0.5
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_h7nko")
|
curve = SubResource("Curve_h7nko")
|
||||||
scaleY = 0.05
|
scaleY = 0.05
|
||||||
scaleRandomRange = 0.1
|
scaleRandomRange = 0.1
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="CameraEffect" load_steps=10 format=3 uid="uid://uyuplc6hm25j"]
|
[gd_resource type="Resource" script_class="CameraEffect" load_steps=10 format=3 uid="uid://uyuplc6hm25j"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffect.cs" id="1_5l6xm"]
|
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffect.cs" id="1_5l6xm"]
|
||||||
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_x21rf"]
|
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_x21rf"]
|
||||||
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="3_lfgu3"]
|
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="3_lfgu3"]
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_62jxv"]
|
[sub_resource type="Curve" id="Curve_62jxv"]
|
||||||
|
|
@ -11,12 +11,8 @@ point_count = 5
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_esvga"]
|
[sub_resource type="Resource" id="Resource_esvga"]
|
||||||
script = ExtResource("1_x21rf")
|
script = ExtResource("1_x21rf")
|
||||||
target = 0
|
|
||||||
flipScaleYRandomly = true
|
flipScaleYRandomly = true
|
||||||
duration = 0.2
|
duration = 0.2
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_62jxv")
|
curve = SubResource("Curve_62jxv")
|
||||||
scaleY = 0.1
|
scaleY = 0.1
|
||||||
scaleRandomRange = 0.2
|
scaleRandomRange = 0.2
|
||||||
|
|
@ -29,11 +25,7 @@ point_count = 6
|
||||||
[sub_resource type="Resource" id="Resource_s8na2"]
|
[sub_resource type="Resource" id="Resource_s8na2"]
|
||||||
script = ExtResource("1_x21rf")
|
script = ExtResource("1_x21rf")
|
||||||
target = 1
|
target = 1
|
||||||
flipScaleYRandomly = false
|
|
||||||
duration = 0.2
|
duration = 0.2
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_h7nko")
|
curve = SubResource("Curve_h7nko")
|
||||||
scaleY = 0.1
|
scaleY = 0.1
|
||||||
scaleRandomRange = 0.2
|
scaleRandomRange = 0.2
|
||||||
|
|
@ -48,12 +40,8 @@ script = ExtResource("1_x21rf")
|
||||||
target = 6
|
target = 6
|
||||||
flipScaleYRandomly = true
|
flipScaleYRandomly = true
|
||||||
duration = 0.3
|
duration = 0.3
|
||||||
durationRandomRange = 0.0
|
|
||||||
delay = 0.0
|
|
||||||
delayRandomRange = 0.0
|
|
||||||
curve = SubResource("Curve_opp1p")
|
curve = SubResource("Curve_opp1p")
|
||||||
scaleY = 10.0
|
scaleY = 10.0
|
||||||
scaleRandomRange = 0.0
|
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_5l6xm")
|
script = ExtResource("1_5l6xm")
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ namespace Rokojori
|
||||||
return self.DirectionTowards( other ).Length();
|
return self.DirectionTowards( other ).Length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float DistanceTo( this Node3D self, Vector3 position )
|
||||||
|
{
|
||||||
|
return self.DirectionTowards( position ).Length();
|
||||||
|
}
|
||||||
|
|
||||||
public static Vector3 DirectionTowards( this Node3D self, Node3D other )
|
public static Vector3 DirectionTowards( this Node3D self, Node3D other )
|
||||||
{
|
{
|
||||||
return ( other.GlobalPosition - self.GlobalPosition );
|
return ( other.GlobalPosition - self.GlobalPosition );
|
||||||
|
|
@ -190,6 +195,33 @@ namespace Rokojori
|
||||||
node.GlobalPosition = gp;
|
node.GlobalPosition = gp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SetScaleX( this Node3D node, float x )
|
||||||
|
{
|
||||||
|
var gp = node.Scale;
|
||||||
|
|
||||||
|
gp.X = x;
|
||||||
|
|
||||||
|
node.Scale = gp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetScaleY( this Node3D node, float y )
|
||||||
|
{
|
||||||
|
var gp = node.Scale;
|
||||||
|
|
||||||
|
gp.Y = y;
|
||||||
|
|
||||||
|
node.Scale = gp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetScaleZ( this Node3D node, float z )
|
||||||
|
{
|
||||||
|
var gp = node.Scale;
|
||||||
|
|
||||||
|
gp.Z = z;
|
||||||
|
|
||||||
|
node.Scale = gp;
|
||||||
|
}
|
||||||
|
|
||||||
public static void SetLocalX( this Node3D node, float x )
|
public static void SetLocalX( this Node3D node, float x )
|
||||||
{
|
{
|
||||||
var gp = node.Position;
|
var gp = node.Position;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Reflection;
|
||||||
|
using Microsoft.VisualBasic;
|
||||||
|
|
||||||
|
namespace Rokojori
|
||||||
|
{
|
||||||
|
public static class NodeExtensions
|
||||||
|
{
|
||||||
|
public static T GetNextSiblingOrChild<T>( this Node node ) where T:Node
|
||||||
|
{
|
||||||
|
var index = node.GetIndex();
|
||||||
|
var p = node.GetParent();
|
||||||
|
|
||||||
|
for ( int i = index + 1; i < p.GetChildCount(); i++ )
|
||||||
|
{
|
||||||
|
var child = p.GetChild( i );
|
||||||
|
|
||||||
|
if ( child != null && child is T t )
|
||||||
|
{
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Nodes.GetAnyChild<T>( node );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cop83tt1k1hs8
|
||||||
|
|
@ -21,6 +21,8 @@ namespace Rokojori
|
||||||
return GetAnyChild<T>( node );
|
return GetAnyChild<T>( node );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static T GetSelfOrChildOf<T>( this Node node ) where T:Node
|
public static T GetSelfOrChildOf<T>( this Node node ) where T:Node
|
||||||
{
|
{
|
||||||
if ( node is T t )
|
if ( node is T t )
|
||||||
|
|
@ -749,7 +751,7 @@ namespace Rokojori
|
||||||
|
|
||||||
public static T GetDirectChild<T>( this Node parent ) where T:Node
|
public static T GetDirectChild<T>( this Node parent ) where T:Node
|
||||||
{
|
{
|
||||||
if ( parent == null )
|
if ( parent == null || ! Node.IsInstanceValid( parent ) )
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
public enum CollisionPhase
|
public enum CollisionPhase
|
||||||
{
|
{
|
||||||
|
None,
|
||||||
Entered,
|
Entered,
|
||||||
Inside,
|
Inside,
|
||||||
Exit
|
Exit
|
||||||
|
|
@ -52,12 +53,26 @@ namespace Rokojori
|
||||||
return collisionTypes.IndexOf( collider.collisionType ) != -1;
|
return collisionTypes.IndexOf( collider.collisionType ) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collider _collider;
|
||||||
|
CollisionPhase _collisionPhase;
|
||||||
|
|
||||||
|
public Collider collider => _collider;
|
||||||
|
public CollisionPhase collisionPhase => _collisionPhase;
|
||||||
|
|
||||||
|
|
||||||
public void Collide( Collider collider, CollisionPhase phase )
|
public void Collide( Collider collider, CollisionPhase phase )
|
||||||
{
|
{
|
||||||
|
// this.LogInfo( "Colliding with", phase, HierarchyName.Of( collider ) );
|
||||||
|
|
||||||
|
_collider = collider;
|
||||||
|
_collisionPhase = phase;
|
||||||
|
|
||||||
_Collide( collider, phase );
|
_Collide( collider, phase );
|
||||||
|
|
||||||
if ( phase == CollisionPhase.Entered )
|
if ( phase == CollisionPhase.Entered )
|
||||||
{
|
{
|
||||||
|
// this.LogInfo( "Entered", HierarchyName.Of( collider ) );
|
||||||
|
|
||||||
if ( onEnteredColliderPose != null )
|
if ( onEnteredColliderPose != null )
|
||||||
{
|
{
|
||||||
onEnteredColliderPose.CopyGlobalPoseFrom( collider.area );
|
onEnteredColliderPose.CopyGlobalPoseFrom( collider.area );
|
||||||
|
|
@ -68,6 +83,8 @@ namespace Rokojori
|
||||||
}
|
}
|
||||||
else if ( phase == CollisionPhase.Inside )
|
else if ( phase == CollisionPhase.Inside )
|
||||||
{
|
{
|
||||||
|
// this.LogInfo( "Inside", HierarchyName.Of( collider ) );
|
||||||
|
|
||||||
if ( onInsideColliderPose != null )
|
if ( onInsideColliderPose != null )
|
||||||
{
|
{
|
||||||
onInsideColliderPose.CopyGlobalPoseFrom( collider.area );
|
onInsideColliderPose.CopyGlobalPoseFrom( collider.area );
|
||||||
|
|
@ -78,6 +95,8 @@ namespace Rokojori
|
||||||
}
|
}
|
||||||
else if ( phase == CollisionPhase.Exit )
|
else if ( phase == CollisionPhase.Exit )
|
||||||
{
|
{
|
||||||
|
// this.LogInfo( "Exit", HierarchyName.Of( collider ) );
|
||||||
|
|
||||||
if ( onExitColliderPose != null )
|
if ( onExitColliderPose != null )
|
||||||
{
|
{
|
||||||
onExitColliderPose.CopyGlobalPoseFrom( collider.area );
|
onExitColliderPose.CopyGlobalPoseFrom( collider.area );
|
||||||
|
|
@ -86,6 +105,9 @@ namespace Rokojori
|
||||||
Action.Trigger( collider.onExit );
|
Action.Trigger( collider.onExit );
|
||||||
Action.Trigger( onExit );
|
Action.Trigger( onExit );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_collider = null;
|
||||||
|
_collisionPhase = CollisionPhase.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void _Collide( Collider collider, CollisionPhase phase )
|
protected virtual void _Collide( Collider collider, CollisionPhase phase )
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public Action onExit;
|
public Action onExit;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool activateAlwaysOnInside = false;
|
||||||
|
|
||||||
|
|
||||||
Dictionary<Collidable,System.Action> _inside = new Dictionary<Collidable,System.Action>();
|
Dictionary<Collidable,System.Action> _inside = new Dictionary<Collidable,System.Action>();
|
||||||
|
|
||||||
public void OnNodeStateChanged()
|
public void OnNodeStateChanged()
|
||||||
|
|
@ -44,28 +48,69 @@ namespace Rokojori
|
||||||
area.AreaEntered += TriggerOnEnter;
|
area.AreaEntered += TriggerOnEnter;
|
||||||
area.BodyEntered += TriggerOnEnter;
|
area.BodyEntered += TriggerOnEnter;
|
||||||
|
|
||||||
area.AreaExited += TriggerOnExited;
|
area.AreaExited += _TriggerOnExited;
|
||||||
area.BodyExited += TriggerOnExited;
|
area.BodyExited += _TriggerOnExited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TriggerOnCollisionEnter( Projectile p, KinematicCollision3D collision )
|
||||||
void TriggerOnEnter( Node n )
|
|
||||||
{
|
{
|
||||||
if ( ! Math3D.IsValid( area.GlobalPosition ) )
|
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
|
||||||
|
_TriggerOnEnter( (Node) collision.GetCollider( 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerOnCollisionExit( Projectile p, KinematicCollision3D collision )
|
||||||
|
{
|
||||||
|
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
|
||||||
|
_TriggerOnExited( (Node) collision.GetCollider( 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerOnEnter( Node3D node3D )
|
||||||
|
{
|
||||||
|
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
|
||||||
|
_TriggerOnEnter( node3D );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerOnExited( Node3D node3D )
|
||||||
|
{
|
||||||
|
// this.LogInfo( HierarchyName.Of( node3D ) );
|
||||||
|
_TriggerOnExited( node3D );
|
||||||
|
}
|
||||||
|
|
||||||
|
Collidable GetCollidable( Node n )
|
||||||
|
{
|
||||||
|
if ( n is Collidable c && c.IsCollidingWith( this ) )
|
||||||
{
|
{
|
||||||
return;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
var collidable = n.Get<Collidable>();
|
return n.FindDirectChild<Collidable>( c => c.IsCollidingWith( this ) );
|
||||||
|
|
||||||
if ( collidable == null || ! collidable.IsCollidingWith( this ) )
|
}
|
||||||
|
|
||||||
|
void _TriggerOnEnter( Node n )
|
||||||
|
{
|
||||||
|
if ( n == null )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( area != null && ! Math3D.IsValid( area.GlobalPosition ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var collidable = GetCollidable( n );
|
||||||
|
|
||||||
|
if ( collidable == null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
collidable.Collide( this, CollisionPhase.Entered );
|
collidable.Collide( this, CollisionPhase.Entered );
|
||||||
|
|
||||||
if ( onInside == null )
|
if ( ( ! activateAlwaysOnInside ) && onInside == null )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -87,11 +132,11 @@ namespace Rokojori
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerOnExited( Node n )
|
void _TriggerOnExited( Node n )
|
||||||
{
|
{
|
||||||
var collidable = n.Get<Collidable>();
|
var collidable = GetCollidable( n );
|
||||||
|
|
||||||
if ( collidable == null || ! collidable.IsCollidingWith( this ) )
|
if ( collidable == null )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Drawing;
|
||||||
namespace Rokojori
|
namespace Rokojori
|
||||||
{
|
{
|
||||||
[Tool]
|
[Tool]
|
||||||
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/SelectorFlag.svg")]
|
[GlobalClass]
|
||||||
public partial class CollisionFlag:SelectorFlag
|
public partial class CollisionFlag:SelectorFlag
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Rokojori
|
||||||
public float rayLength = 10;
|
public float rayLength = 10;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public int maxHits = 100;
|
public int maxHits = 3;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public bool sortByPointerPriority;
|
public bool sortByPointerPriority;
|
||||||
|
|
@ -38,9 +38,8 @@ namespace Rokojori
|
||||||
|
|
||||||
public override int NumColliders()
|
public override int NumColliders()
|
||||||
{
|
{
|
||||||
return numCollisions;
|
return collisions == null ? 0 : numCollisions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override Node GetCollider( int index )
|
public override Node GetCollider( int index )
|
||||||
{
|
{
|
||||||
|
|
@ -85,9 +84,12 @@ namespace Rokojori
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool runInEditor = false;
|
||||||
|
|
||||||
void Update( double delta )
|
void Update( double delta )
|
||||||
{
|
{
|
||||||
if ( Engine.IsEditorHint() )
|
if ( Engine.IsEditorHint() && ! runInEditor )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -132,7 +134,7 @@ namespace Rokojori
|
||||||
var excludes = new Array<Rid>();
|
var excludes = new Array<Rid>();
|
||||||
|
|
||||||
var from = GlobalPosition;
|
var from = GlobalPosition;
|
||||||
var to = from + this.GlobalForward() * rayLength;
|
var to = from + this.GlobalForward().Normalized() * rayLength;
|
||||||
|
|
||||||
this.to = to;
|
this.to = to;
|
||||||
|
|
||||||
|
|
@ -148,7 +150,7 @@ namespace Rokojori
|
||||||
var collisionData = GetCollisionData( numCollisions );
|
var collisionData = GetCollisionData( numCollisions );
|
||||||
collisionData.Get( rayParameters, physics );
|
collisionData.Get( rayParameters, physics );
|
||||||
|
|
||||||
if ( ! collisionData.hasCollision )
|
if ( ! collisionData.hasCollision || this.DistanceTo( collisionData.position ) > rayLength )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,13 @@ namespace Rokojori
|
||||||
SetFromNormalAndCoplanarPoint( normal, a );
|
SetFromNormalAndCoplanarPoint( normal, a );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Plane3 CreateFromNormalAndCoplanarPoint( Vector3 normal, Vector3 point )
|
||||||
|
{
|
||||||
|
var p = new Plane3();
|
||||||
|
p.SetFromNormalAndCoplanarPoint( normal, point );
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
public static Plane3 FromCoplanarPoints( Vector3 a, Vector3 b, Vector3 c )
|
public static Plane3 FromCoplanarPoints( Vector3 a, Vector3 b, Vector3 c )
|
||||||
{
|
{
|
||||||
var p = new Plane3();
|
var p = new Plane3();
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,7 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
var result = physicsState.IntersectRay( ray );
|
var result = physicsState.IntersectRay( ray );
|
||||||
|
|
||||||
|
if ( ! result.ContainsKey( "collider" ) || result[ "collider" ].As<Node>() == null )
|
||||||
|
|
||||||
if ( ! result.ContainsKey( "collider" ) )
|
|
||||||
{
|
{
|
||||||
hasCollision = false;
|
hasCollision = false;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
using Godot;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Rokojori
|
||||||
|
{
|
||||||
|
[Tool]
|
||||||
|
[GlobalClass]
|
||||||
|
public partial class Projectile:CharacterBody3D
|
||||||
|
{
|
||||||
|
[Export]
|
||||||
|
public float speed = 0;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool disableOnCollision = false;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool disabled = false;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Collider collider;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Action onCollision;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool runInEditor = false;
|
||||||
|
|
||||||
|
|
||||||
|
public override void _PhysicsProcess( double delta )
|
||||||
|
{
|
||||||
|
if ( disabled || ( Engine.IsEditorHint() && ! runInEditor ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var velocity = this.GlobalForward() * speed * (float)delta;
|
||||||
|
|
||||||
|
var collision = MoveAndCollide( velocity );
|
||||||
|
|
||||||
|
if ( collision == null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( collider != null)
|
||||||
|
{
|
||||||
|
collider.TriggerOnCollisionEnter( this, collision );
|
||||||
|
}
|
||||||
|
|
||||||
|
Action.Trigger( onCollision );
|
||||||
|
|
||||||
|
if ( disableOnCollision )
|
||||||
|
{
|
||||||
|
disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://baohlfn1nwjsk
|
||||||
|
|
@ -35,11 +35,11 @@ namespace Rokojori
|
||||||
|
|
||||||
if ( ta == null )
|
if ( ta == null )
|
||||||
{
|
{
|
||||||
this.LogInfo( "No attributes found..." );
|
// this.LogInfo( "No attributes found..." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.LogInfo( "Index", index, "Value:", value, "Channel:", channel );
|
// this.LogInfo( "Index", index, "Value:", value, "Channel:", channel );
|
||||||
ta.SetChannel( index, value, channel, operatorType );
|
ta.SetChannel( index, value, channel, operatorType );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public bool processSensors = true;
|
public bool processSensors = true;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool autoScan = true;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public Node[] autoScanForSensors = [];
|
public Node[] autoScanForSensors = [];
|
||||||
|
|
||||||
|
|
@ -135,7 +138,7 @@ namespace Rokojori
|
||||||
|
|
||||||
hasDevice = true;
|
hasDevice = true;
|
||||||
|
|
||||||
this.LogInfo( "Device Type Change:", lastActiveDevice.GetInfo() );
|
// this.LogInfo( "Device Type Change:", lastActiveDevice.GetInfo() );
|
||||||
|
|
||||||
if ( confineMouse && DefaultSensorDeviceSelector.IsMouseDevice( lastActiveDevice ) )
|
if ( confineMouse && DefaultSensorDeviceSelector.IsMouseDevice( lastActiveDevice ) )
|
||||||
{
|
{
|
||||||
|
|
@ -378,7 +381,9 @@ namespace Rokojori
|
||||||
typeof( Area3D ),
|
typeof( Area3D ),
|
||||||
typeof( CharacterBody3D ),
|
typeof( CharacterBody3D ),
|
||||||
typeof( AudioStreamPlayer3D ),
|
typeof( AudioStreamPlayer3D ),
|
||||||
typeof( ReflectionProbe )
|
typeof( ReflectionProbe ),
|
||||||
|
typeof( SensorManager ),
|
||||||
|
typeof( SensorManagerSetup )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -495,6 +500,20 @@ namespace Rokojori
|
||||||
Nodes.ForEach<Node>( n, n => AddSensorsFrom( n ) );
|
Nodes.ForEach<Node>( n, n => AddSensorsFrom( n ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( autoScan )
|
||||||
|
{
|
||||||
|
this.ForEachInRoot<Node>(
|
||||||
|
( n )=>
|
||||||
|
{
|
||||||
|
if ( IsIgnoreType( n ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AddSensorsFrom( n );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
// if ( autoScanParent )
|
// if ( autoScanParent )
|
||||||
// {
|
// {
|
||||||
// Nodes.ForEach<Node>( GetParent(), AddSensorsFrom );
|
// Nodes.ForEach<Node>( GetParent(), AddSensorsFrom );
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public bool initializeOnReady = true;
|
public bool initializeOnReady = true;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool processSensors = true;
|
||||||
|
|
||||||
|
[ExportGroup( "Sensor Scanning" )]
|
||||||
[Export]
|
[Export]
|
||||||
public Sensor[] sensors = [];
|
public Sensor[] sensors = [];
|
||||||
|
|
||||||
|
|
@ -18,7 +22,7 @@ namespace Rokojori
|
||||||
public SensorGroup[] sensorGroups = [];
|
public SensorGroup[] sensorGroups = [];
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public bool processSensors = true;
|
public bool autoScan = true;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public Node[] autoScanForSensors = [];
|
public Node[] autoScanForSensors = [];
|
||||||
|
|
@ -26,6 +30,8 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public bool autoScanParent = true;
|
public bool autoScanParent = true;
|
||||||
|
|
||||||
|
[ExportGroup( "Debugging Options")]
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public bool separateMouseAndKeyboardTracking = false;
|
public bool separateMouseAndKeyboardTracking = false;
|
||||||
|
|
||||||
|
|
@ -50,6 +56,7 @@ namespace Rokojori
|
||||||
sm.sensors = sensors;
|
sm.sensors = sensors;
|
||||||
sm.sensorGroups = sensorGroups;
|
sm.sensorGroups = sensorGroups;
|
||||||
sm.processSensors = processSensors;
|
sm.processSensors = processSensors;
|
||||||
|
sm.autoScan = autoScan;
|
||||||
sm.autoScanForSensors = autoScanForSensors;
|
sm.autoScanForSensors = autoScanForSensors;
|
||||||
sm.separateMouseAndKeyboardTracking = separateMouseAndKeyboardTracking;
|
sm.separateMouseAndKeyboardTracking = separateMouseAndKeyboardTracking;
|
||||||
sm.onActiveDeviceChange = onActiveDeviceChange;
|
sm.onActiveDeviceChange = onActiveDeviceChange;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public bool autoStart = true;
|
public bool autoStart = true;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool executesInPause = false;
|
||||||
|
|
||||||
public static float osTime => (float)( Time.GetTicksMsec() / 1000.0 );
|
public static float osTime => (float)( Time.GetTicksMsec() / 1000.0 );
|
||||||
|
|
||||||
public TimeLineRunner runner
|
public TimeLineRunner runner
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,15 @@ namespace Rokojori
|
||||||
|
|
||||||
public bool inProcess => _inProcess;
|
public bool inProcess => _inProcess;
|
||||||
|
|
||||||
|
bool _paused = false;
|
||||||
|
public bool paused => _paused;
|
||||||
|
|
||||||
public override void _Process( double delta )
|
public override void _Process( double delta )
|
||||||
{
|
{
|
||||||
_inProcess = true;
|
_inProcess = true;
|
||||||
|
|
||||||
|
_paused = GetTree().Paused;
|
||||||
|
|
||||||
UpdateRealTime( delta );
|
UpdateRealTime( delta );
|
||||||
|
|
||||||
if ( ! Engine.IsEditorHint() && gametimeTimeline != null )
|
if ( ! Engine.IsEditorHint() && gametimeTimeline != null )
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Rokojori
|
||||||
|
|
||||||
public void UpdateTimeLine( float realtimeDelta )
|
public void UpdateTimeLine( float realtimeDelta )
|
||||||
{
|
{
|
||||||
if ( ! playing )
|
if ( ! playing || ( manager.paused && ! timeLine.executesInPause ))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
[gd_resource type="Resource" script_class="TimeLine" load_steps=2 format=3 uid="uid://h6oi6vkj4c2m"]
|
[gd_resource type="Resource" script_class="TimeLine" load_steps=2 format=3 uid="uid://h6oi6vkj4c2m"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Time/TimeLine.cs" id="1_0ltdh"]
|
[ext_resource type="Script" uid="uid://fqm54rn8fnnl" path="res://addons/rokojori_action_library/Runtime/Time/TimeLine.cs" id="1_0ltdh"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0ltdh")
|
script = ExtResource("1_0ltdh")
|
||||||
|
executesInPause = true
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,4 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_xynux")
|
script = ExtResource("1_xynux")
|
||||||
isLooping = false
|
executesInPause = true
|
||||||
loopStart = 0.0
|
|
||||||
loopEnd = 100000.0
|
|
||||||
startSpeed = 1.0
|
|
||||||
autoStart = true
|
|
||||||
|
|
|
||||||
|
|
@ -57,19 +57,19 @@ namespace Rokojori
|
||||||
|
|
||||||
if ( iiLib == null )
|
if ( iiLib == null )
|
||||||
{
|
{
|
||||||
this.LogInfo( "No Input lib!" );
|
// this.LogInfo( "No Input lib!" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var icons = iiLib.ResolveIcons( inputIcons );
|
var icons = iiLib.ResolveIcons( inputIcons );
|
||||||
|
|
||||||
this.LogInfo( "Resolved Icons:\n", inputIcons, "\n>>\n", icons );
|
// this.LogInfo( "Resolved Icons:\n", inputIcons, "\n>>\n", icons );
|
||||||
|
|
||||||
if ( deviceFilter != null )
|
if ( deviceFilter != null )
|
||||||
{
|
{
|
||||||
var iconsBefore = Lists.From( icons );
|
var iconsBefore = Lists.From( icons );
|
||||||
icons = Lists.Filter( icons, i => deviceFilter.BelongsToDevice( i ) );
|
icons = Lists.Filter( icons, i => deviceFilter.BelongsToDevice( i ) );
|
||||||
this.LogInfo( "Device Filtered Icons:\n", iconsBefore, "\n>>\n", icons );
|
// this.LogInfo( "Device Filtered Icons:\n", iconsBefore, "\n>>\n", icons );
|
||||||
}
|
}
|
||||||
|
|
||||||
icons = iiLib.ResolveIcons( icons.ToArray() );
|
icons = iiLib.ResolveIcons( icons.ToArray() );
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Rokojori
|
||||||
localeText.locale = locale;
|
localeText.locale = locale;
|
||||||
|
|
||||||
localeText.font = iiLib.font;
|
localeText.font = iiLib.font;
|
||||||
localeText.fontSize = iiLib.fontSize;
|
localeText.fontSize = this.fontSize != null ? this.fontSize : iiLib.fontSize;
|
||||||
|
|
||||||
localeText.Uppercase = upperCase;
|
localeText.Uppercase = upperCase;
|
||||||
localeText.marginLeft = UINumber.EM( 0.25f );
|
localeText.marginLeft = UINumber.EM( 0.25f );
|
||||||
|
|
@ -134,11 +134,11 @@ namespace Rokojori
|
||||||
|
|
||||||
if ( id == null )
|
if ( id == null )
|
||||||
{
|
{
|
||||||
this.LogInfo( "No definition found >> ", inputIcon );
|
// this.LogInfo( "No definition found >> ", inputIcon );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.LogInfo( "Definition found >> ", inputIcon );
|
// this.LogInfo( "Definition found >> ", inputIcon );
|
||||||
|
|
||||||
var iconRegion = this.CreateChild<UIRegion>();
|
var iconRegion = this.CreateChild<UIRegion>();
|
||||||
var elements = id.GetIconElementsForIcon( inputIcon );
|
var elements = id.GetIconElementsForIcon( inputIcon );
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_wm644"]
|
[sub_resource type="Resource" id="Resource_wm644"]
|
||||||
script = ExtResource("3_xon8j")
|
script = ExtResource("3_xon8j")
|
||||||
value = 0.5
|
value = 1.5
|
||||||
unit = "vw"
|
unit = "vw"
|
||||||
metadata/_custom_type_script = "uid://cnkyynboxg1qg"
|
metadata/_custom_type_script = "uid://cnkyynboxg1qg"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue