Jam Updates
This commit is contained in:
parent
e5166dd7cf
commit
08dbd8681b
|
@ -7,7 +7,7 @@ namespace Rokojori
|
||||||
{
|
{
|
||||||
[Tool]
|
[Tool]
|
||||||
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
|
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
|
||||||
public partial class OnCollision:Node
|
public partial class OnCollision:Node,iNodeState
|
||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
public Area3D area;
|
public Area3D area;
|
||||||
|
@ -28,6 +28,24 @@ namespace Rokojori
|
||||||
|
|
||||||
Dictionary<Node,System.Action> _inside = new Dictionary<Node,System.Action>();
|
Dictionary<Node,System.Action> _inside = new Dictionary<Node,System.Action>();
|
||||||
|
|
||||||
|
List<Node> _nodes = new List<Node>();
|
||||||
|
|
||||||
|
public List<Node> GetNodesInside()
|
||||||
|
{
|
||||||
|
_nodes = _nodes.Filter( n => n != null && IsInstanceValid( n ) );
|
||||||
|
|
||||||
|
return _nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
Node.ProcessModeEnum processMode, bool visible )
|
||||||
|
{
|
||||||
|
if ( ! processEnabled || ! physicsEnabled || Node.ProcessModeEnum.Disabled == processMode )
|
||||||
|
{
|
||||||
|
this.LogInfo( "Clearing nodes" );
|
||||||
|
_nodes.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
@ -56,9 +74,15 @@ namespace Rokojori
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! _nodes.Contains( n ) )
|
||||||
|
{
|
||||||
|
_nodes.Add( n );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
|
||||||
|
|
||||||
|
// this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
||||||
Action.Trigger( onEntered );
|
Action.Trigger( onEntered );
|
||||||
|
|
||||||
if ( onInside == null )
|
if ( onInside == null )
|
||||||
|
@ -81,6 +105,8 @@ namespace Rokojori
|
||||||
|
|
||||||
void TriggerOnExited( Node n )
|
void TriggerOnExited( Node n )
|
||||||
{
|
{
|
||||||
|
_nodes.Remove( n );
|
||||||
|
|
||||||
if ( ! Selector.IsSelecting( selector, n ) )
|
if ( ! Selector.IsSelecting( selector, n ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -88,6 +114,8 @@ namespace Rokojori
|
||||||
|
|
||||||
Action.Trigger( onExit );
|
Action.Trigger( onExit );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( ! _inside.ContainsKey( n ) )
|
if ( ! _inside.ContainsKey( n ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
using Godot;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Rokojori
|
||||||
|
{
|
||||||
|
[Tool][GlobalClass]
|
||||||
|
public partial class RemoveNode : Action
|
||||||
|
{
|
||||||
|
[Export]
|
||||||
|
public Node target;
|
||||||
|
|
||||||
|
protected override void _OnTrigger()
|
||||||
|
{
|
||||||
|
if ( target != null )
|
||||||
|
{
|
||||||
|
target.SelfDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dq5kae8x62gre
|
|
@ -50,8 +50,13 @@ namespace Rokojori
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// [ExportToolButton( "Initialize")]
|
[ExportToolButton( "Initialize")]
|
||||||
// public Callable InitializeButton => Callable.From( Initialize );
|
public Callable InitializeButton => Callable.From( Initialize );
|
||||||
|
|
||||||
|
public override void _Process( double delta )
|
||||||
|
{
|
||||||
|
Engine.MaxFps = _fps;
|
||||||
|
}
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,6 +5,13 @@ using System;
|
||||||
|
|
||||||
namespace Rokojori
|
namespace Rokojori
|
||||||
{
|
{
|
||||||
|
public interface iNodeState
|
||||||
|
{
|
||||||
|
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
Node.ProcessModeEnum processMode, bool visible );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static class NodeState
|
public static class NodeState
|
||||||
{
|
{
|
||||||
public static void Configure( Node n, bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
public static void Configure( Node n, bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||||
|
@ -22,6 +29,12 @@ namespace Rokojori
|
||||||
|
|
||||||
n.ProcessMode = processMode;
|
n.ProcessMode = processMode;
|
||||||
|
|
||||||
|
if ( n is iNodeState ins )
|
||||||
|
{
|
||||||
|
ins.OnNodeStateChanged( processEnabled, inputEnabled, physicsEnabled, signalsEnabled,
|
||||||
|
processMode, visible );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( n is Node3D )
|
if ( n is Node3D )
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public Sensor button;
|
public Sensor button;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Action onInteract;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
SensorManager.Register( this, button );
|
SensorManager.Register( this, button );
|
||||||
|
|
|
@ -19,6 +19,9 @@ namespace Rokojori
|
||||||
[Export]
|
[Export]
|
||||||
public Pointable pointable;
|
public Pointable pointable;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public bool printPointables = false;
|
||||||
|
|
||||||
public override void _Process( double delta )
|
public override void _Process( double delta )
|
||||||
{
|
{
|
||||||
if ( caster == null )
|
if ( caster == null )
|
||||||
|
@ -52,6 +55,11 @@ namespace Rokojori
|
||||||
pointable.UpdatePointerState( this, true );
|
pointable.UpdatePointerState( this, true );
|
||||||
Highlight( HighlightActionType.Start, pointable );
|
Highlight( HighlightActionType.Start, pointable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( printPointables )
|
||||||
|
{
|
||||||
|
this.LogInfo( pointable );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlight( HighlightActionType type, Pointable p )
|
void Highlight( HighlightActionType type, Pointable p )
|
||||||
|
|
|
@ -48,6 +48,7 @@ namespace Rokojori
|
||||||
|
|
||||||
particles.CustomAabb = Box3.WithSize( 10000 );
|
particles.CustomAabb = Box3.WithSize( 10000 );
|
||||||
|
|
||||||
|
|
||||||
processMaterial.positionVariance.Set( renderLayer.renderer.noise );
|
processMaterial.positionVariance.Set( renderLayer.renderer.noise );
|
||||||
processMaterial.rotationVariance.Set( renderLayer.renderer.noise );
|
processMaterial.rotationVariance.Set( renderLayer.renderer.noise );
|
||||||
processMaterial.scaleVariance.Set( renderLayer.renderer.noise );
|
processMaterial.scaleVariance.Set( renderLayer.renderer.noise );
|
||||||
|
@ -60,6 +61,8 @@ namespace Rokojori
|
||||||
particles.DrawPasses = 1;
|
particles.DrawPasses = 1;
|
||||||
particles.DrawPass1 = meshInstance.Mesh;
|
particles.DrawPass1 = meshInstance.Mesh;
|
||||||
|
|
||||||
|
particles.CastShadow = GeometryInstance3D.ShadowCastingSetting.Off;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue