29 lines
389 B
C#
29 lines
389 B
C#
|
|
|
||
|
|
using Godot;
|
||
|
|
|
||
|
|
|
||
|
|
namespace Rokojori
|
||
|
|
{
|
||
|
|
[Tool][GlobalClass ]
|
||
|
|
public partial class CopyYaw : Action
|
||
|
|
{
|
||
|
|
[Export]
|
||
|
|
public Node3D source;
|
||
|
|
|
||
|
|
[Export]
|
||
|
|
public Node3D target;
|
||
|
|
|
||
|
|
protected override void _OnTrigger()
|
||
|
|
{
|
||
|
|
if ( source == null || target == null )
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
target.SetGlobalYaw( source.GlobalYawRadians() );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|