Complete C# rewrite with working game in Editor (#6)
* Refactor collectable components to C# and update resource scripts for consistency * Update resource paths and refactor properties for consistency * Refactor UI components to inherit from Control and update node paths for consistency * Update node paths and group assignments for consistency across scenes * Refactor GameManager and PlayerDeathComponent for improved state management and logging; update scene connections for player death handling * Add PhantomCamera components and UI elements for improved scene management; refactor existing components for better integration * Refactor skill components and update resource paths for consistency; enhance skill management in scenes * Add new UID files and update scene configurations for dialogue components; refactor skill management and input handling * Add next level command and refactor player retrieval in GameManager; update scene files for consistency * Add skill upgrade system and refactor skill components for enhanced functionality; update resource paths and configurations * Enhance ChargeProgressBar and Marketplace functionality; add owner exit handling and update skill button states * Refactor ChargeProgressBar and SkillManager; update skill handling and improve component interactions * Refactor player and level configurations; streamline FlipPlayerComponent and reposition Spaceship Enter
This commit is contained in:
253
addons/phantom_camera/scripts/phantom_camera/PhantomCamera.cs
Normal file
253
addons/phantom_camera/scripts/phantom_camera/PhantomCamera.cs
Normal file
@@ -0,0 +1,253 @@
|
||||
using Godot;
|
||||
using PhantomCamera.Noise;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace PhantomCamera;
|
||||
|
||||
public enum InactiveUpdateMode
|
||||
{
|
||||
Always,
|
||||
Never
|
||||
}
|
||||
|
||||
public abstract class PhantomCamera
|
||||
{
|
||||
protected readonly GodotObject Node;
|
||||
|
||||
public delegate void BecameActiveEventHandler();
|
||||
public delegate void BecameInactiveEventHandler();
|
||||
public delegate void FollowTargetChangedEventHandler();
|
||||
public delegate void DeadZoneChangedEventHandler();
|
||||
public delegate void TweenStartedEventHandler();
|
||||
public delegate void IsTweeningEventHandler();
|
||||
public delegate void TweenCompletedEventHandler();
|
||||
|
||||
public event BecameActiveEventHandler? BecameActive;
|
||||
public event BecameInactiveEventHandler? BecameInactive;
|
||||
public event FollowTargetChangedEventHandler? FollowTargetChanged;
|
||||
public event DeadZoneChangedEventHandler? DeadZoneChanged;
|
||||
public event TweenStartedEventHandler? TweenStarted;
|
||||
public event IsTweeningEventHandler? IsTweening;
|
||||
public event TweenCompletedEventHandler? TweenCompleted;
|
||||
|
||||
private readonly Callable _callableBecameActive;
|
||||
private readonly Callable _callableBecameInactive;
|
||||
private readonly Callable _callableFollowTargetChanged;
|
||||
private readonly Callable _callableDeadZoneChanged;
|
||||
private readonly Callable _callableTweenStarted;
|
||||
private readonly Callable _callableIsTweening;
|
||||
private readonly Callable _callableTweenCompleted;
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get => (int)Node.Call(MethodName.GetPriority);
|
||||
set => Node.Call(MethodName.SetPriority, value);
|
||||
}
|
||||
|
||||
public bool IsActive => (bool)Node.Call(MethodName.IsActive);
|
||||
|
||||
public bool FollowDamping
|
||||
{
|
||||
get => (bool)Node.Call(MethodName.GetFollowDamping);
|
||||
set => Node.Call(MethodName.SetFollowDamping, value);
|
||||
}
|
||||
|
||||
public bool IsFollowing => (bool)Node.Call(PhantomCamera.MethodName.IsFollowing);
|
||||
|
||||
public float DeadZoneWidth
|
||||
{
|
||||
get => (float)Node.Get(PropertyName.DeadZoneWidth);
|
||||
set => Node.Set(PropertyName.DeadZoneWidth, value);
|
||||
}
|
||||
|
||||
public float DeadZoneHeight
|
||||
{
|
||||
get => (float)Node.Get(PropertyName.DeadZoneHeight);
|
||||
set => Node.Set(PropertyName.DeadZoneHeight, value);
|
||||
}
|
||||
|
||||
public PhantomCameraTween TweenResource
|
||||
{
|
||||
get => new((Resource)Node.Call(MethodName.GetTweenResource));
|
||||
set => Node.Call(MethodName.SetTweenResource, (GodotObject)value.Resource);
|
||||
}
|
||||
|
||||
public bool TweenSkip
|
||||
{
|
||||
get => (bool)Node.Call(MethodName.GetTweenSkip);
|
||||
set => Node.Call(MethodName.SetTweenSkip, value);
|
||||
}
|
||||
|
||||
public float TweenDuration
|
||||
{
|
||||
get => (float)Node.Call(MethodName.GetTweenDuration);
|
||||
set => Node.Call(MethodName.SetTweenDuration, value);
|
||||
}
|
||||
|
||||
public TransitionType TweenTransition
|
||||
{
|
||||
get => (TransitionType)(int)Node.Call(MethodName.GetTweenTransition);
|
||||
set => Node.Call(MethodName.SetTweenTransition, (int)value);
|
||||
}
|
||||
|
||||
public EaseType TweenEase
|
||||
{
|
||||
get => (EaseType)(int)Node.Call(MethodName.GetTweenEase);
|
||||
set => Node.Call(MethodName.SetTweenEase, (int)value);
|
||||
}
|
||||
|
||||
public bool TweenOnLoad
|
||||
{
|
||||
get => (bool)Node.Call(MethodName.GetTweenOnLoad);
|
||||
set => Node.Call(MethodName.SetTweenOnLoad, value);
|
||||
}
|
||||
|
||||
public InactiveUpdateMode InactiveUpdateMode
|
||||
{
|
||||
get => (InactiveUpdateMode)(int)Node.Call(MethodName.GetInactiveUpdateMode);
|
||||
set => Node.Call(MethodName.SetInactiveUpdateMode, (int)value);
|
||||
}
|
||||
|
||||
public int HostLayers
|
||||
{
|
||||
get => (int)Node.Call(MethodName.GetHostLayers);
|
||||
set => Node.Call(MethodName.SetHostLayers, value);
|
||||
}
|
||||
|
||||
public int NoiseEmitterLayer
|
||||
{
|
||||
get => (int)Node.Call(MethodName.GetNoiseEmitterLayer);
|
||||
set => Node.Call(MethodName.SetNoiseEmitterLayer, value);
|
||||
}
|
||||
|
||||
public void TeleportPosition()
|
||||
{
|
||||
Node.Call(MethodName.TeleportPosition);
|
||||
}
|
||||
|
||||
public void SetHostLayersValue(int layer, bool enabled)
|
||||
{
|
||||
Node.Call(MethodName.SetHostLayersValue, layer, enabled);
|
||||
}
|
||||
|
||||
protected PhantomCamera(GodotObject phantomCameraNode)
|
||||
{
|
||||
Node = phantomCameraNode;
|
||||
|
||||
_callableBecameActive = Callable.From(() => BecameActive?.Invoke());
|
||||
_callableBecameInactive = Callable.From(() => BecameInactive?.Invoke());
|
||||
_callableFollowTargetChanged = Callable.From(() => FollowTargetChanged?.Invoke());
|
||||
_callableDeadZoneChanged = Callable.From(() => DeadZoneChanged?.Invoke());
|
||||
_callableTweenStarted = Callable.From(() => TweenStarted?.Invoke());
|
||||
_callableIsTweening = Callable.From(() => IsTweening?.Invoke());
|
||||
_callableTweenCompleted = Callable.From(() => TweenCompleted?.Invoke());
|
||||
|
||||
Node.Connect(SignalName.BecameActive, _callableBecameActive);
|
||||
Node.Connect(SignalName.BecameInactive, _callableBecameInactive);
|
||||
Node.Connect(SignalName.FollowTargetChanged, _callableFollowTargetChanged);
|
||||
Node.Connect(SignalName.DeadZoneChanged, _callableDeadZoneChanged);
|
||||
Node.Connect(SignalName.TweenStarted, _callableTweenStarted);
|
||||
Node.Connect(SignalName.IsTweening, _callableIsTweening);
|
||||
Node.Connect(SignalName.TweenCompleted, _callableTweenCompleted);
|
||||
}
|
||||
|
||||
~PhantomCamera()
|
||||
{
|
||||
Node.Disconnect(SignalName.BecameActive, _callableBecameActive);
|
||||
Node.Disconnect(SignalName.BecameInactive, _callableBecameInactive);
|
||||
Node.Disconnect(SignalName.FollowTargetChanged, _callableFollowTargetChanged);
|
||||
Node.Disconnect(SignalName.DeadZoneChanged, _callableDeadZoneChanged);
|
||||
Node.Disconnect(SignalName.TweenStarted, _callableTweenStarted);
|
||||
Node.Disconnect(SignalName.IsTweening, _callableIsTweening);
|
||||
Node.Disconnect(SignalName.TweenCompleted, _callableTweenCompleted);
|
||||
}
|
||||
|
||||
public static class MethodName
|
||||
{
|
||||
public const string GetFollowMode = "get_follow_mode";
|
||||
public const string IsActive = "is_active";
|
||||
|
||||
public const string GetPriority = "get_priority";
|
||||
public const string SetPriority = "set_priority";
|
||||
|
||||
public const string IsFollowing = "is_following";
|
||||
|
||||
public const string GetFollowTarget = "get_follow_target";
|
||||
public const string SetFollowTarget = "set_follow_target";
|
||||
|
||||
public const string GetFollowTargets = "get_follow_targets";
|
||||
public const string SetFollowTargets = "set_follow_targets";
|
||||
|
||||
public const string TeleportPosition = "teleport_position";
|
||||
|
||||
public const string AppendFollowTargets = "append_follow_targets";
|
||||
public const string AppendFollowTargetsArray = "append_follow_targets_array";
|
||||
public const string EraseFollowTargets = "erase_follow_targets";
|
||||
|
||||
public const string GetFollowPath = "get_follow_path";
|
||||
public const string SetFollowPath = "set_follow_path";
|
||||
|
||||
public const string GetFollowOffset = "get_follow_offset";
|
||||
public const string SetFollowOffset = "set_follow_offset";
|
||||
|
||||
public const string GetFollowDamping = "get_follow_damping";
|
||||
public const string SetFollowDamping = "set_follow_damping";
|
||||
|
||||
public const string GetFollowDampingValue = "get_follow_damping_value";
|
||||
public const string SetFollowDampingValue = "set_follow_damping_value";
|
||||
|
||||
public const string GetFollowAxisLock = "get_follow_axis_lock";
|
||||
public const string SetFollowAxisLock = "set_follow_axis_lock";
|
||||
|
||||
public const string GetTweenResource = "get_tween_resource";
|
||||
public const string SetTweenResource = "set_tween_resource";
|
||||
|
||||
public const string GetTweenSkip = "get_tween_skip";
|
||||
public const string SetTweenSkip = "set_tween_skip";
|
||||
|
||||
public const string GetTweenDuration = "get_tween_duration";
|
||||
public const string SetTweenDuration = "set_tween_duration";
|
||||
|
||||
public const string GetTweenTransition = "get_tween_transition";
|
||||
public const string SetTweenTransition = "set_tween_transition";
|
||||
|
||||
public const string GetTweenEase = "get_tween_ease";
|
||||
public const string SetTweenEase = "set_tween_ease";
|
||||
|
||||
public const string GetTweenOnLoad = "get_tween_on_load";
|
||||
public const string SetTweenOnLoad = "set_tween_on_load";
|
||||
|
||||
public const string GetInactiveUpdateMode = "get_inactive_update_mode";
|
||||
public const string SetInactiveUpdateMode = "set_inactive_update_mode";
|
||||
|
||||
public const string GetHostLayers = "get_host_layers";
|
||||
public const string SetHostLayers = "set_host_layers";
|
||||
public const string SetHostLayersValue = "set_host_layers_value";
|
||||
|
||||
public const string GetNoiseEmitterLayer = "get_noise_emitter_layer";
|
||||
public const string SetNoiseEmitterLayer = "set_noise_emitter_layer";
|
||||
|
||||
public const string EmitNoise = "emit_noise";
|
||||
}
|
||||
|
||||
public static class PropertyName
|
||||
{
|
||||
public const string DeadZoneWidth = "dead_zone_width";
|
||||
public const string DeadZoneHeight = "dead_zone_height";
|
||||
}
|
||||
|
||||
public static class SignalName
|
||||
{
|
||||
public const string BecameActive = "became_active";
|
||||
public const string BecameInactive = "became_inactive";
|
||||
public const string FollowTargetChanged = "follow_target_changed";
|
||||
public const string DeadZoneChanged = "dead_zone_changed";
|
||||
public const string DeadZoneReached = "dead_zone_reached";
|
||||
public const string TweenStarted = "tween_started";
|
||||
public const string IsTweening = "is_tweening";
|
||||
public const string TweenCompleted = "tween_completed";
|
||||
public const string TweenInterrupted = "tween_interrupted";
|
||||
public const string NoiseEmitted = "noise_emitted";
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
uid://d3wh0457i0i3
|
351
addons/phantom_camera/scripts/phantom_camera/PhantomCamera2D.cs
Normal file
351
addons/phantom_camera/scripts/phantom_camera/PhantomCamera2D.cs
Normal file
@@ -0,0 +1,351 @@
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using PhantomCamera.Noise;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace PhantomCamera;
|
||||
|
||||
public enum FollowMode2D
|
||||
{
|
||||
None,
|
||||
Glued,
|
||||
Simple,
|
||||
Group,
|
||||
Path,
|
||||
Framed
|
||||
}
|
||||
|
||||
public enum FollowLockAxis2D
|
||||
{
|
||||
None,
|
||||
X,
|
||||
Y,
|
||||
XY
|
||||
}
|
||||
|
||||
public static class PhantomCamera2DExtensions
|
||||
{
|
||||
public static PhantomCamera2D AsPhantomCamera2D(this Node2D node2D)
|
||||
{
|
||||
return new PhantomCamera2D(node2D);
|
||||
}
|
||||
|
||||
public static PhantomCameraNoiseEmitter2D AsPhantomCameraNoiseEmitter2D(this Node2D node2D)
|
||||
{
|
||||
return new PhantomCameraNoiseEmitter2D(node2D);
|
||||
}
|
||||
|
||||
public static PhantomCameraNoise2D AsPhantomCameraNoise2D(this Resource resource)
|
||||
{
|
||||
return new PhantomCameraNoise2D(resource);
|
||||
}
|
||||
}
|
||||
|
||||
public class PhantomCamera2D : PhantomCamera
|
||||
{
|
||||
public Node2D Node2D => (Node2D)Node;
|
||||
|
||||
public delegate void TweenInterruptedEventHandler(Node2D pCam);
|
||||
public delegate void DeadZoneReachedEventHandler(Vector2 side);
|
||||
public delegate void NoiseEmittedEventHandler(Transform2D output);
|
||||
|
||||
public event TweenInterruptedEventHandler? TweenInterrupted;
|
||||
public event DeadZoneReachedEventHandler? DeadZoneReached;
|
||||
public event NoiseEmittedEventHandler? NoiseEmitted;
|
||||
|
||||
private readonly Callable _callableTweenInterrupted;
|
||||
private readonly Callable _callableDeadZoneReached;
|
||||
private readonly Callable _callableNoiseEmitted;
|
||||
|
||||
public Node2D FollowTarget
|
||||
{
|
||||
get => (Node2D)Node2D.Call(PhantomCamera.MethodName.GetFollowTarget);
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowTarget, value);
|
||||
}
|
||||
|
||||
public Node2D[] FollowTargets
|
||||
{
|
||||
get => Node2D.Call(PhantomCamera.MethodName.GetFollowTargets).AsGodotArray<Node2D>().ToArray();
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowTargets, new Array<Node2D>(value));
|
||||
}
|
||||
|
||||
public void AppendFollowTargets(Node2D target) => Node2D.Call(PhantomCamera.MethodName.AppendFollowTargets, target);
|
||||
public void AppendFollowTargetsArray(Node2D[] targets) => Node2D.Call(PhantomCamera.MethodName.AppendFollowTargetsArray, targets);
|
||||
public void EraseFollowTargets(Node2D target) => Node2D.Call(PhantomCamera.MethodName.EraseFollowTargets, target);
|
||||
|
||||
public FollowMode2D FollowMode => (FollowMode2D)(int)Node.Call(PhantomCamera.MethodName.GetFollowMode);
|
||||
|
||||
public Path2D FollowPath
|
||||
{
|
||||
get => (Path2D)Node2D.Call(PhantomCamera.MethodName.GetFollowPath);
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowPath, value);
|
||||
}
|
||||
|
||||
public Vector2 FollowOffset
|
||||
{
|
||||
get => (Vector2)Node2D.Call(PhantomCamera.MethodName.GetFollowOffset);
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowOffset, value);
|
||||
}
|
||||
|
||||
public Vector2 FollowDampingValue
|
||||
{
|
||||
get => (Vector2)Node2D.Call(PhantomCamera.MethodName.GetFollowDampingValue);
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowDampingValue, value);
|
||||
}
|
||||
|
||||
public FollowLockAxis2D FollowAxisLock
|
||||
{
|
||||
get => (FollowLockAxis2D)(int)Node2D.Call(PhantomCamera.MethodName.GetFollowAxisLock);
|
||||
set => Node2D.Call(PhantomCamera.MethodName.SetFollowAxisLock, (int)value);
|
||||
}
|
||||
|
||||
public Vector2 Zoom
|
||||
{
|
||||
get => (Vector2)Node2D.Call(MethodName.GetZoom);
|
||||
set => Node2D.Call(MethodName.SetZoom, value);
|
||||
}
|
||||
|
||||
public bool SnapToPixel
|
||||
{
|
||||
get => (bool)Node2D.Call(MethodName.GetSnapToPixel);
|
||||
set => Node2D.Call(MethodName.SetSnapToPixel, value);
|
||||
}
|
||||
|
||||
public bool RotateWithTarget
|
||||
{
|
||||
get => (bool)Node2D.Call(MethodName.GetRotateWithTarget);
|
||||
set => Node2D.Call(MethodName.SetRotateWithTarget, value);
|
||||
}
|
||||
|
||||
public float RotationOffset
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetRotationOffset);
|
||||
set => Node2D.Call(MethodName.SetRotationOffset, value);
|
||||
}
|
||||
|
||||
public bool RotationDamping
|
||||
{
|
||||
get => (bool)Node2D.Call(MethodName.GetRotationDamping);
|
||||
set => Node2D.Call(MethodName.SetRotationDamping, value);
|
||||
}
|
||||
|
||||
public float RotationDampingValue
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetRotationDampingValue);
|
||||
set => Node2D.Call(MethodName.SetRotationDampingValue, value);
|
||||
}
|
||||
|
||||
public int LimitLeft
|
||||
{
|
||||
get => (int)Node2D.Call(MethodName.GetLimitLeft);
|
||||
set => Node2D.Call(MethodName.SetLimitLeft, value);
|
||||
}
|
||||
|
||||
public int LimitTop
|
||||
{
|
||||
get => (int)Node2D.Call(MethodName.GetLimitTop);
|
||||
set => Node2D.Call(MethodName.SetLimitTop, value);
|
||||
}
|
||||
|
||||
public int LimitRight
|
||||
{
|
||||
get => (int)Node2D.Call(MethodName.GetLimitRight);
|
||||
set => Node2D.Call(MethodName.SetLimitRight, value);
|
||||
}
|
||||
|
||||
public int LimitBottom
|
||||
{
|
||||
get => (int)Node2D.Call(MethodName.GetLimitBottom);
|
||||
set => Node2D.Call(MethodName.SetLimitBottom, value);
|
||||
}
|
||||
|
||||
public Vector4I LimitMargin
|
||||
{
|
||||
get => (Vector4I)Node2D.Call(MethodName.GetLimitMargin);
|
||||
set => Node2D.Call(MethodName.SetLimitMargin, value);
|
||||
}
|
||||
|
||||
public bool AutoZoom
|
||||
{
|
||||
get => (bool)Node2D.Call(MethodName.GetAutoZoom);
|
||||
set => Node2D.Call(MethodName.SetAutoZoom, value);
|
||||
}
|
||||
|
||||
public float AutoZoomMin
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetAutoZoomMin);
|
||||
set => Node2D.Call(MethodName.SetAutoZoomMin, value);
|
||||
}
|
||||
|
||||
public float AutoZoomMax
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetAutoZoomMax);
|
||||
set => Node2D.Call(MethodName.SetAutoZoomMax, value);
|
||||
}
|
||||
|
||||
public Vector4 AutoZoomMargin
|
||||
{
|
||||
get => (Vector4)Node2D.Call(MethodName.GetAutoZoomMargin);
|
||||
set => Node2D.Call(MethodName.SetAutoZoomMargin, value);
|
||||
}
|
||||
|
||||
public bool DrawLimits
|
||||
{
|
||||
get => (bool)Node2D.Get(PropertyName.DrawLimits);
|
||||
set => Node2D.Set(PropertyName.DrawLimits, value);
|
||||
}
|
||||
|
||||
public PhantomCameraNoise2D Noise
|
||||
{
|
||||
get => new((Resource)Node2D.Call(MethodName.GetNoise));
|
||||
set => Node2D.Call(MethodName.SetNoise, (GodotObject)value.Resource);
|
||||
}
|
||||
|
||||
public void EmitNoise(Transform2D transform) => Node2D.Call(PhantomCamera.MethodName.EmitNoise, transform);
|
||||
|
||||
public NodePath LimitTarget
|
||||
{
|
||||
get => (NodePath)Node2D.Call(MethodName.GetLimitTarget);
|
||||
set => Node2D.Call(MethodName.SetLimitTarget, value);
|
||||
}
|
||||
|
||||
public static PhantomCamera2D FromScript(string path) => new(GD.Load<GDScript>(path).New().AsGodotObject());
|
||||
public static PhantomCamera2D FromScript(GDScript script) => new(script.New().AsGodotObject());
|
||||
|
||||
public PhantomCamera2D(GodotObject phantomCameraNode) : base(phantomCameraNode)
|
||||
{
|
||||
_callableTweenInterrupted = Callable.From<Node2D>(pCam => TweenInterrupted?.Invoke(pCam));
|
||||
_callableDeadZoneReached = Callable.From((Vector2 side) => DeadZoneReached?.Invoke(side));
|
||||
_callableNoiseEmitted = Callable.From((Transform2D output) => NoiseEmitted?.Invoke(output));
|
||||
|
||||
Node2D.Connect(SignalName.TweenInterrupted, _callableTweenInterrupted);
|
||||
Node2D.Connect(SignalName.DeadZoneReached, _callableDeadZoneReached);
|
||||
Node2D.Connect(SignalName.NoiseEmitted, _callableNoiseEmitted);
|
||||
}
|
||||
|
||||
~PhantomCamera2D()
|
||||
{
|
||||
Node2D.Disconnect(SignalName.TweenInterrupted, _callableTweenInterrupted);
|
||||
Node2D.Disconnect(SignalName.DeadZoneReached, _callableDeadZoneReached);
|
||||
Node2D.Disconnect(SignalName.NoiseEmitted, _callableNoiseEmitted);
|
||||
}
|
||||
|
||||
public void SetLimitTarget(TileMap tileMap)
|
||||
{
|
||||
Node2D.Call(MethodName.SetLimitTarget, tileMap.GetPath());
|
||||
}
|
||||
|
||||
public void SetLimitTarget(TileMapLayer tileMapLayer)
|
||||
{
|
||||
Node2D.Call(MethodName.SetLimitTarget, tileMapLayer.GetPath());
|
||||
}
|
||||
|
||||
public void SetLimitTarget(CollisionShape2D shape2D)
|
||||
{
|
||||
Node2D.Call(MethodName.SetLimitTarget, shape2D.GetPath());
|
||||
}
|
||||
|
||||
public LimitTargetQueryResult? GetLimitTarget()
|
||||
{
|
||||
var result = (NodePath)Node2D.Call(MethodName.GetLimitTarget);
|
||||
return result.IsEmpty ? null : new LimitTargetQueryResult(Node2D.GetNode(result));
|
||||
}
|
||||
|
||||
public void SetLimit(Side side, int value)
|
||||
{
|
||||
Node2D.Call(MethodName.SetLimit, (int)side, value);
|
||||
}
|
||||
|
||||
public int GetLimit(Side side)
|
||||
{
|
||||
return (int)Node2D.Call(MethodName.GetLimit, (int)side);
|
||||
}
|
||||
|
||||
public new static class MethodName
|
||||
{
|
||||
public const string GetZoom = "get_zoom";
|
||||
public const string SetZoom = "set_zoom";
|
||||
|
||||
public const string GetSnapToPixel = "get_snap_to_pixel";
|
||||
public const string SetSnapToPixel = "set_snap_to_pixel";
|
||||
|
||||
public const string GetRotateWithTarget = "get_rotate_with_target";
|
||||
public const string SetRotateWithTarget = "set_rotate_with_target";
|
||||
|
||||
public const string GetRotationOffset = "get_rotation_offset";
|
||||
public const string SetRotationOffset = "set_rotation_offset";
|
||||
|
||||
public const string GetRotationDamping = "get_rotation_damping";
|
||||
public const string SetRotationDamping = "set_rotation_damping";
|
||||
|
||||
public const string GetRotationDampingValue = "get_rotation_damping_value";
|
||||
public const string SetRotationDampingValue = "set_rotation_damping_value";
|
||||
|
||||
public const string GetLimit = "get_limit";
|
||||
public const string SetLimit = "set_limit";
|
||||
|
||||
public const string GetLimitLeft = "get_limit_left";
|
||||
public const string SetLimitLeft = "set_limit_left";
|
||||
|
||||
public const string GetLimitTop = "get_limit_top";
|
||||
public const string SetLimitTop = "set_limit_top";
|
||||
|
||||
public const string GetLimitRight = "get_limit_right";
|
||||
public const string SetLimitRight = "set_limit_right";
|
||||
|
||||
public const string GetLimitBottom = "get_limit_bottom";
|
||||
public const string SetLimitBottom = "set_limit_bottom";
|
||||
|
||||
public const string GetLimitTarget = "get_limit_target";
|
||||
public const string SetLimitTarget = "set_limit_target";
|
||||
|
||||
public const string GetLimitMargin = "get_limit_margin";
|
||||
public const string SetLimitMargin = "set_limit_margin";
|
||||
|
||||
public const string GetAutoZoom = "get_auto_zoom";
|
||||
public const string SetAutoZoom = "set_auto_zoom";
|
||||
|
||||
public const string GetAutoZoomMin = "get_auto_zoom_min";
|
||||
public const string SetAutoZoomMin = "set_auto_zoom_min";
|
||||
|
||||
public const string GetAutoZoomMax = "get_auto_zoom_max";
|
||||
public const string SetAutoZoomMax = "set_auto_zoom_max";
|
||||
|
||||
public const string GetAutoZoomMargin = "get_auto_zoom_margin";
|
||||
public const string SetAutoZoomMargin = "set_auto_zoom_margin";
|
||||
|
||||
public const string GetNoise = "get_noise";
|
||||
public const string SetNoise = "set_noise";
|
||||
}
|
||||
|
||||
public new static class PropertyName
|
||||
{
|
||||
public const string DrawLimits = "draw_limits";
|
||||
}
|
||||
}
|
||||
|
||||
public class LimitTargetQueryResult(GodotObject godotObject)
|
||||
{
|
||||
public bool IsTileMap => godotObject.IsClass("TileMap");
|
||||
|
||||
public bool IsTileMapLayer => godotObject.IsClass("TileMapLayer");
|
||||
|
||||
public bool IsCollisionShape2D => godotObject.IsClass("CollisionShape2D");
|
||||
|
||||
public TileMap? AsTileMap()
|
||||
{
|
||||
return IsTileMap ? (TileMap)godotObject : null;
|
||||
}
|
||||
|
||||
public TileMapLayer? AsTileMapLayer()
|
||||
{
|
||||
return IsTileMapLayer ? (TileMapLayer)godotObject : null;
|
||||
}
|
||||
|
||||
public CollisionShape2D? AsCollisionShape2D()
|
||||
{
|
||||
return IsCollisionShape2D ? (CollisionShape2D)godotObject : null;
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
uid://c38e5qhsf3fk3
|
493
addons/phantom_camera/scripts/phantom_camera/PhantomCamera3D.cs
Normal file
493
addons/phantom_camera/scripts/phantom_camera/PhantomCamera3D.cs
Normal file
@@ -0,0 +1,493 @@
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using PhantomCamera.Noise;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace PhantomCamera;
|
||||
|
||||
public enum LookAtMode
|
||||
{
|
||||
None,
|
||||
Mimic,
|
||||
Simple,
|
||||
Group
|
||||
}
|
||||
|
||||
public enum FollowMode3D
|
||||
{
|
||||
None,
|
||||
Glued,
|
||||
Simple,
|
||||
Group,
|
||||
Path,
|
||||
Framed,
|
||||
ThirdPerson
|
||||
}
|
||||
|
||||
public enum FollowLockAxis3D
|
||||
{
|
||||
None,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
XY,
|
||||
XZ,
|
||||
YZ,
|
||||
XYZ
|
||||
}
|
||||
|
||||
public static class PhantomCamera3DExtensions
|
||||
{
|
||||
public static PhantomCamera3D AsPhantomCamera3D(this Node3D node3D)
|
||||
{
|
||||
return new PhantomCamera3D(node3D);
|
||||
}
|
||||
|
||||
public static PhantomCameraNoiseEmitter3D AsPhantomCameraNoiseEmitter3D(this Node3D node3D)
|
||||
{
|
||||
return new PhantomCameraNoiseEmitter3D(node3D);
|
||||
}
|
||||
|
||||
public static PhantomCameraNoise3D AsPhantomCameraNoise3D(this Resource resource)
|
||||
{
|
||||
return new PhantomCameraNoise3D(resource);
|
||||
}
|
||||
|
||||
public static Camera3DResource AsCamera3DResource(this Resource resource)
|
||||
{
|
||||
return new Camera3DResource(resource);
|
||||
}
|
||||
|
||||
public static Vector3 GetThirdPersonRotation(this PhantomCamera3D pCam3D) =>
|
||||
(Vector3)pCam3D.Node3D.Call(PhantomCamera3D.MethodName.GetThirdPersonRotation);
|
||||
|
||||
public static void SetThirdPersonRotation(this PhantomCamera3D pCam3D, Vector3 rotation) =>
|
||||
pCam3D.Node3D.Call(PhantomCamera3D.MethodName.SetThirdPersonRotation, rotation);
|
||||
|
||||
public static Vector3 GetThirdPersonRotationDegrees(this PhantomCamera3D pCam3D) =>
|
||||
(Vector3)pCam3D.Node3D.Call(PhantomCamera3D.MethodName.GetThirdPersonRotationDegrees);
|
||||
|
||||
public static void SetThirdPersonDegrees(this PhantomCamera3D pCam3D, Vector3 rotation) =>
|
||||
pCam3D.Node3D.Call(PhantomCamera3D.MethodName.SetThirdPersonRotationDegrees, rotation);
|
||||
|
||||
public static Quaternion GetThirdPersonQuaternion(this PhantomCamera3D pCam3D) =>
|
||||
(Quaternion)pCam3D.Node3D.Call(PhantomCamera3D.MethodName.GetThirdPersonQuaternion);
|
||||
|
||||
public static void SetThirdPersonQuaternion(this PhantomCamera3D pCam3D, Quaternion quaternion) =>
|
||||
pCam3D.Node3D.Call(PhantomCamera3D.MethodName.SetThirdPersonQuaternion, quaternion);
|
||||
|
||||
}
|
||||
|
||||
public class PhantomCamera3D : PhantomCamera
|
||||
{
|
||||
public Node3D Node3D => (Node3D)Node;
|
||||
|
||||
public delegate void LookAtTargetChangedEventHandler();
|
||||
public delegate void DeadZoneReachedEventHandler();
|
||||
public delegate void Camera3DResourceChangedEventHandler();
|
||||
public delegate void Camera3DResourcePropertyChangedEventHandler(StringName property, Variant value);
|
||||
public delegate void TweenInterruptedEventHandler(Node3D pCam);
|
||||
public delegate void NoiseEmittedEventHandler(Transform3D output);
|
||||
|
||||
public event LookAtTargetChangedEventHandler? LookAtTargetChanged;
|
||||
public event DeadZoneReachedEventHandler? DeadZoneReached;
|
||||
public event Camera3DResourceChangedEventHandler? Camera3DResourceChanged;
|
||||
public event Camera3DResourcePropertyChangedEventHandler? Camera3DResourcePropertyChanged;
|
||||
public event TweenInterruptedEventHandler? TweenInterrupted;
|
||||
public event NoiseEmittedEventHandler? NoiseEmitted;
|
||||
|
||||
private readonly Callable _callableLookAtTargetChanged;
|
||||
private readonly Callable _callableDeadZoneReached;
|
||||
private readonly Callable _callableCamera3DResourceChanged;
|
||||
private readonly Callable _callableCamera3DResourcePropertyChanged;
|
||||
private readonly Callable _callableTweenInterrupted;
|
||||
private readonly Callable _callableNoiseEmitted;
|
||||
|
||||
public Node3D FollowTarget
|
||||
{
|
||||
get => (Node3D)Node3D.Call(PhantomCamera.MethodName.GetFollowTarget);
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowTarget, value);
|
||||
}
|
||||
|
||||
public Node3D[] FollowTargets
|
||||
{
|
||||
get => Node3D.Call(PhantomCamera.MethodName.GetFollowTargets).AsGodotArray<Node3D>().ToArray();
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowTargets, new Array<Node3D>(value));
|
||||
}
|
||||
|
||||
public void AppendFollowTarget(Node3D target) => Node3D.Call(PhantomCamera.MethodName.AppendFollowTargets, target);
|
||||
public void AppendFollowTargetArray(Node3D[] targets) => Node3D.Call(PhantomCamera.MethodName.AppendFollowTargetsArray, targets);
|
||||
public void EraseFollowTarget(Node3D target) => Node3D.Call(PhantomCamera.MethodName.EraseFollowTargets, target);
|
||||
|
||||
public FollowMode3D FollowMode => (FollowMode3D)(int)Node.Call(PhantomCamera.MethodName.GetFollowMode);
|
||||
|
||||
public Path3D FollowPath
|
||||
{
|
||||
get => (Path3D)Node3D.Call(PhantomCamera.MethodName.GetFollowPath);
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowPath, value);
|
||||
}
|
||||
|
||||
public Vector3 FollowOffset
|
||||
{
|
||||
get => (Vector3)Node3D.Call(PhantomCamera.MethodName.GetFollowOffset);
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowOffset, value);
|
||||
}
|
||||
|
||||
public Vector3 FollowDampingValue
|
||||
{
|
||||
get => (Vector3)Node3D.Call(PhantomCamera.MethodName.GetFollowDampingValue);
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowDampingValue, value);
|
||||
}
|
||||
|
||||
public FollowLockAxis3D FollowAxisLock
|
||||
{
|
||||
get => (FollowLockAxis3D)(int)Node3D.Call(PhantomCamera.MethodName.GetFollowAxisLock);
|
||||
set => Node3D.Call(PhantomCamera.MethodName.SetFollowAxisLock, (int)value);
|
||||
}
|
||||
|
||||
public LookAtMode LookAtMode => (LookAtMode)(int)Node3D.Call(MethodName.GetLookAtMode);
|
||||
|
||||
public Camera3DResource Camera3DResource
|
||||
{
|
||||
get => new((Resource)Node3D.Call(MethodName.GetCamera3DResource));
|
||||
set => Node3D.Call(MethodName.SetCamera3DResource, value.Resource);
|
||||
}
|
||||
|
||||
public float SpringLength
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetSpringLength);
|
||||
set => Node3D.Call(MethodName.SetSpringLength, value);
|
||||
}
|
||||
|
||||
public float VerticalRotationOffset
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetVerticalRotationOffset);
|
||||
set => Node3D.Call(MethodName.SetVerticalRotationOffset, value);
|
||||
}
|
||||
|
||||
public float HorizontalRotationOffset
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetHorizontalRotationOffset);
|
||||
set => Node3D.Call(MethodName.SetHorizontalRotationOffset, value);
|
||||
}
|
||||
|
||||
public float FollowDistance
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetFollowDistance);
|
||||
set => Node3D.Call(MethodName.SetFollowDistance, value);
|
||||
}
|
||||
|
||||
public bool AutoFollowDistance
|
||||
{
|
||||
get => (bool)Node3D.Call(MethodName.GetAutoFollowDistance);
|
||||
set => Node3D.Call(MethodName.SetAutoFollowDistance, value);
|
||||
}
|
||||
|
||||
public float AutoFollowDistanceMin
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetAutoFollowDistanceMin);
|
||||
set => Node3D.Call(MethodName.SetAutoFollowDistanceMin, value);
|
||||
}
|
||||
|
||||
public float AutoFollowDistanceMax
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetAutoFollowDistanceMax);
|
||||
set => Node3D.Call(MethodName.SetAutoFollowDistanceMax, value);
|
||||
}
|
||||
|
||||
public float AutoFollowDistanceDivisor
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetAutoFollowDistanceDivisor);
|
||||
set => Node3D.Call(MethodName.SetAutoFollowDistanceDivisor, value);
|
||||
}
|
||||
|
||||
public Node3D LookAtTarget
|
||||
{
|
||||
get => (Node3D)Node3D.Call(MethodName.GetLookAtTarget);
|
||||
set => Node3D.Call(MethodName.SetLookAtTarget, value);
|
||||
}
|
||||
|
||||
public Node3D[] LookAtTargets
|
||||
{
|
||||
get => Node3D.Call(MethodName.GetLookAtTargets).AsGodotArray<Node3D>().ToArray();
|
||||
set => Node3D.Call(MethodName.SetLookAtTargets, new Array<Node3D>(value));
|
||||
}
|
||||
|
||||
public bool IsLooking => (bool)Node3D.Call(MethodName.IsLooking);
|
||||
|
||||
public int CollisionMask
|
||||
{
|
||||
get => (int)Node3D.Call(MethodName.GetCollisionMask);
|
||||
set => Node3D.Call(MethodName.SetCollisionMask, value);
|
||||
}
|
||||
|
||||
public void SetCollisionMaskValue(int maskLayer, bool enable) =>
|
||||
Node3D.Call(MethodName.SetCollisionMaskValue, maskLayer, enable);
|
||||
|
||||
public Shape3D Shape
|
||||
{
|
||||
get => (Shape3D)Node3D.Call(MethodName.GetShape);
|
||||
set => Node3D.Call(MethodName.SetShape, value);
|
||||
}
|
||||
|
||||
public float Margin
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetMargin);
|
||||
set => Node3D.Call(MethodName.SetMargin, value);
|
||||
}
|
||||
|
||||
public Vector3 LookAtOffset
|
||||
{
|
||||
get => (Vector3)Node3D.Call(MethodName.GetLookAtOffset);
|
||||
set => Node3D.Call(MethodName.SetLookAtOffset, value);
|
||||
}
|
||||
|
||||
public bool LookAtDamping
|
||||
{
|
||||
get => (bool)Node3D.Call(MethodName.GetLookAtDamping);
|
||||
set => Node3D.Call(MethodName.SetLookAtDamping, value);
|
||||
}
|
||||
|
||||
public float LookAtDampingValue
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetLookAtDampingValue);
|
||||
set => Node3D.Call(MethodName.SetLookAtDampingValue, value);
|
||||
}
|
||||
|
||||
public Node3D Up
|
||||
{
|
||||
get => (Node3D)Node3D.Call(MethodName.GetUp);
|
||||
set => Node3D.Call(MethodName.SetUp, value);
|
||||
}
|
||||
|
||||
public Vector3 UpTarget
|
||||
{
|
||||
get => (Vector3)Node3D.Call(MethodName.GetUpTarget);
|
||||
set => Node3D.Call(MethodName.SetUpTarget, value);
|
||||
}
|
||||
|
||||
public int CullMask
|
||||
{
|
||||
get => (int)Node3D.Call(MethodName.GetCullMask);
|
||||
set => Node3D.Call(MethodName.SetCullMask, value);
|
||||
}
|
||||
|
||||
public float HOffset
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetHOffset);
|
||||
set => Node3D.Call(MethodName.SetHOffset, value);
|
||||
}
|
||||
|
||||
public float VOffset
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetVOffset);
|
||||
set => Node3D.Call(MethodName.SetVOffset, value);
|
||||
}
|
||||
|
||||
public ProjectionType Projection
|
||||
{
|
||||
get => (ProjectionType)(int)Node3D.Call(MethodName.GetProjection);
|
||||
set => Node3D.Call(MethodName.SetProjection, (int)value);
|
||||
}
|
||||
|
||||
public float Fov
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetFov);
|
||||
set => Node3D.Call(MethodName.SetFov, value);
|
||||
}
|
||||
|
||||
public float Size
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetSize);
|
||||
set => Node3D.Call(MethodName.SetSize, value);
|
||||
}
|
||||
|
||||
public Vector2 FrustumOffset
|
||||
{
|
||||
get => (Vector2)Node3D.Call(MethodName.GetFrustumOffset);
|
||||
set => Node3D.Call(MethodName.SetFrustumOffset, value);
|
||||
}
|
||||
|
||||
public float Far
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetFar);
|
||||
set => Node3D.Call(MethodName.SetFar, value);
|
||||
}
|
||||
|
||||
public float Near
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetNear);
|
||||
set => Node3D.Call(MethodName.SetNear, value);
|
||||
}
|
||||
|
||||
public Environment Environment
|
||||
{
|
||||
get => (Environment)Node3D.Call(MethodName.GetEnvironment);
|
||||
set => Node3D.Call(MethodName.SetEnvironment, value);
|
||||
}
|
||||
|
||||
public CameraAttributes Attributes
|
||||
{
|
||||
get => (CameraAttributes)Node3D.Call(MethodName.GetAttributes);
|
||||
set => Node3D.Call(MethodName.SetAttributes, value);
|
||||
}
|
||||
|
||||
public PhantomCameraNoise3D Noise
|
||||
{
|
||||
get => new((Resource)Node3D.Call(MethodName.GetNoise));
|
||||
set => Node3D.Call(MethodName.SetNoise, (GodotObject)value.Resource);
|
||||
}
|
||||
|
||||
public void EmitNoise(Transform3D transform) => Node3D.Call(PhantomCamera.MethodName.EmitNoise, transform);
|
||||
|
||||
public static PhantomCamera3D FromScript(string path) => new(GD.Load<GDScript>(path).New().AsGodotObject());
|
||||
public static PhantomCamera3D FromScript(GDScript script) => new(script.New().AsGodotObject());
|
||||
|
||||
public PhantomCamera3D(GodotObject phantomCamera3DNode) : base(phantomCamera3DNode)
|
||||
{
|
||||
_callableLookAtTargetChanged = Callable.From(() => LookAtTargetChanged?.Invoke());
|
||||
_callableDeadZoneReached = Callable.From(() => DeadZoneReached?.Invoke());
|
||||
_callableCamera3DResourceChanged = Callable.From(() => Camera3DResourceChanged?.Invoke());
|
||||
_callableCamera3DResourcePropertyChanged = Callable.From((StringName property, Variant value) =>
|
||||
Camera3DResourcePropertyChanged?.Invoke(property, value));
|
||||
_callableTweenInterrupted = Callable.From<Node3D>(pCam => TweenInterrupted?.Invoke(pCam));
|
||||
_callableNoiseEmitted = Callable.From((Transform3D output) => NoiseEmitted?.Invoke(output));
|
||||
|
||||
Node3D.Connect(SignalName.LookAtTargetChanged, _callableLookAtTargetChanged);
|
||||
Node3D.Connect(PhantomCamera.SignalName.DeadZoneReached, _callableDeadZoneReached);
|
||||
Node3D.Connect(SignalName.Camera3DResourceChanged, _callableCamera3DResourceChanged);
|
||||
Node3D.Connect(SignalName.Camera3DResourcePropertyChanged, _callableCamera3DResourcePropertyChanged);
|
||||
Node3D.Connect(PhantomCamera.SignalName.TweenInterrupted, _callableTweenInterrupted);
|
||||
Node3D.Connect(PhantomCamera.SignalName.NoiseEmitted, _callableNoiseEmitted);
|
||||
}
|
||||
|
||||
~PhantomCamera3D()
|
||||
{
|
||||
Node3D.Disconnect(SignalName.LookAtTargetChanged, _callableLookAtTargetChanged);
|
||||
Node3D.Disconnect(PhantomCamera.SignalName.DeadZoneReached, _callableDeadZoneReached);
|
||||
Node3D.Disconnect(SignalName.Camera3DResourceChanged, _callableCamera3DResourceChanged);
|
||||
Node3D.Disconnect(SignalName.Camera3DResourcePropertyChanged, _callableCamera3DResourcePropertyChanged);
|
||||
Node3D.Disconnect(PhantomCamera.SignalName.TweenInterrupted, _callableTweenInterrupted);
|
||||
Node3D.Disconnect(PhantomCamera.SignalName.NoiseEmitted, _callableNoiseEmitted);
|
||||
}
|
||||
|
||||
public new static class MethodName
|
||||
{
|
||||
public const string GetLookAtMode = "get_look_at_mode";
|
||||
|
||||
public const string GetCamera3DResource = "get_camera_3d_resource";
|
||||
public const string SetCamera3DResource = "set_camera_3d_resource";
|
||||
|
||||
public const string GetThirdPersonRotation = "get_third_person_rotation";
|
||||
public const string SetThirdPersonRotation = "set_third_person_rotation";
|
||||
|
||||
public const string GetThirdPersonRotationDegrees = "get_third_person_rotation_degrees";
|
||||
public const string SetThirdPersonRotationDegrees = "set_third_person_rotation_degrees";
|
||||
|
||||
public const string GetThirdPersonQuaternion = "get_third_person_quaternion";
|
||||
public const string SetThirdPersonQuaternion = "set_third_person_quaternion";
|
||||
|
||||
public const string GetVerticalRotationOffset = "get_vertical_rotation_offset";
|
||||
public const string SetVerticalRotationOffset = "set_vertical_rotation_offset";
|
||||
|
||||
public const string GetHorizontalRotationOffset = "get_horizontal_rotation_offset";
|
||||
public const string SetHorizontalRotationOffset = "set_horizontal_rotation_offset";
|
||||
|
||||
public const string GetSpringLength = "get_spring_length";
|
||||
public const string SetSpringLength = "set_spring_length";
|
||||
|
||||
public const string GetFollowDistance = "get_follow_distance";
|
||||
public const string SetFollowDistance = "set_follow_distance";
|
||||
|
||||
public const string GetAutoFollowDistance = "get_auto_follow_distance";
|
||||
public const string SetAutoFollowDistance = "set_auto_follow_distance";
|
||||
|
||||
public const string GetAutoFollowDistanceMin = "get_auto_follow_distance_min";
|
||||
public const string SetAutoFollowDistanceMin = "set_auto_follow_distance_min";
|
||||
|
||||
public const string GetAutoFollowDistanceMax = "get_auto_follow_distance_max";
|
||||
public const string SetAutoFollowDistanceMax = "set_auto_follow_distance_max";
|
||||
|
||||
public const string GetAutoFollowDistanceDivisor = "get_auto_follow_distance_divisor";
|
||||
public const string SetAutoFollowDistanceDivisor = "set_auto_follow_distance_divisor";
|
||||
|
||||
public const string GetLookAtTarget = "get_look_at_target";
|
||||
public const string SetLookAtTarget = "set_look_at_target";
|
||||
|
||||
public const string GetLookAtTargets = "get_look_at_targets";
|
||||
public const string SetLookAtTargets = "set_look_at_targets";
|
||||
|
||||
public const string IsLooking = "is_looking";
|
||||
|
||||
public const string GetUp = "get_up";
|
||||
public const string SetUp = "set_up";
|
||||
|
||||
public const string GetUpTarget = "get_up_target";
|
||||
public const string SetUpTarget = "set_up_target";
|
||||
|
||||
public const string GetCollisionMask = "get_collision_mask";
|
||||
public const string SetCollisionMask = "set_collision_mask";
|
||||
|
||||
public const string SetCollisionMaskValue = "set_collision_mask_value";
|
||||
|
||||
public const string GetShape = "get_shape";
|
||||
public const string SetShape = "set_shape";
|
||||
|
||||
public const string GetMargin = "get_margin";
|
||||
public const string SetMargin = "set_margin";
|
||||
|
||||
public const string GetLookAtOffset = "get_look_at_offset";
|
||||
public const string SetLookAtOffset = "set_look_at_offset";
|
||||
|
||||
public const string GetLookAtDamping = "get_look_at_damping";
|
||||
public const string SetLookAtDamping = "set_look_at_damping";
|
||||
|
||||
public const string GetLookAtDampingValue = "get_look_at_damping_value";
|
||||
public const string SetLookAtDampingValue = "set_look_at_damping_value";
|
||||
|
||||
public const string GetCullMask = "get_cull_mask";
|
||||
public const string SetCullMask = "set_cull_mask";
|
||||
|
||||
public const string GetHOffset = "get_h_offset";
|
||||
public const string SetHOffset = "set_h_offset";
|
||||
|
||||
public const string GetVOffset = "get_v_offset";
|
||||
public const string SetVOffset = "set_v_offset";
|
||||
|
||||
public const string GetProjection = "get_projection";
|
||||
public const string SetProjection = "set_projection";
|
||||
|
||||
public const string GetFov = "get_fov";
|
||||
public const string SetFov = "set_fov";
|
||||
|
||||
public const string GetSize = "get_size";
|
||||
public const string SetSize = "set_size";
|
||||
|
||||
public const string GetFrustumOffset = "get_frustum_offset";
|
||||
public const string SetFrustumOffset = "set_frustum_offset";
|
||||
|
||||
public const string GetFar = "get_far";
|
||||
public const string SetFar = "set_far";
|
||||
|
||||
public const string GetNear = "get_near";
|
||||
public const string SetNear = "set_near";
|
||||
|
||||
public const string GetEnvironment = "get_environment";
|
||||
public const string SetEnvironment = "set_environment";
|
||||
|
||||
public const string GetAttributes = "get_attributes";
|
||||
public const string SetAttributes = "set_attributes";
|
||||
|
||||
public const string GetNoise = "get_noise";
|
||||
public const string SetNoise = "set_noise";
|
||||
}
|
||||
|
||||
public new static class SignalName
|
||||
{
|
||||
public const string LookAtTargetChanged = "look_at_target_changed";
|
||||
public const string Camera3DResourceChanged = "camera_3d_resource_changed";
|
||||
public const string Camera3DResourcePropertyChanged = "camera_3d_resource_property_changed";
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
uid://bx3g7jxtwhi04
|
@@ -0,0 +1,83 @@
|
||||
using Godot;
|
||||
|
||||
namespace PhantomCamera.Noise;
|
||||
|
||||
public class PhantomCameraNoiseEmitter2D(GodotObject node)
|
||||
{
|
||||
public Node2D Node2D = (Node2D)node;
|
||||
|
||||
public PhantomCameraNoise2D Noise
|
||||
{
|
||||
get => new((Resource)Node2D.Call(MethodName.GetNoise));
|
||||
set => Node2D.Call(MethodName.SetNoise, (GodotObject)value.Resource);
|
||||
}
|
||||
|
||||
public bool Continuous
|
||||
{
|
||||
get => (bool)Node2D.Call(MethodName.GetContinuous);
|
||||
set => Node2D.Call(MethodName.SetContinuous, value);
|
||||
}
|
||||
|
||||
public float GrowthTime
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetGrowthTime);
|
||||
set => Node2D.Call(MethodName.SetGrowthTime, value);
|
||||
}
|
||||
|
||||
public float Duration
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetDuration);
|
||||
set => Node2D.Call(MethodName.SetDuration, value);
|
||||
}
|
||||
|
||||
public float DecayTime
|
||||
{
|
||||
get => (float)Node2D.Call(MethodName.GetDecayTime);
|
||||
set => Node2D.Call(MethodName.SetDecayTime, value);
|
||||
}
|
||||
|
||||
public int NoiseEmitterLayer
|
||||
{
|
||||
get => (int)Node2D.Call(MethodName.GetNoiseEmitterLayer);
|
||||
set => Node2D.Call(MethodName.SetNoiseEmitterLayer, value);
|
||||
}
|
||||
|
||||
public void SetNoiseEmitterLayerValue(int layer, bool value) =>
|
||||
Node2D.Call(MethodName.SetNoiseEmitterLayerValue, layer, value);
|
||||
|
||||
public void Emit() => Node2D.Call(MethodName.Emit);
|
||||
|
||||
public bool IsEmitting() => (bool)Node2D.Call(MethodName.IsEmitting);
|
||||
|
||||
public void Stop() => Node2D.Call(MethodName.Stop);
|
||||
|
||||
public void Toggle() => Node2D.Call(MethodName.Toggle);
|
||||
|
||||
public static class MethodName
|
||||
{
|
||||
public const string GetNoise = "get_noise";
|
||||
public const string SetNoise = "set_noise";
|
||||
|
||||
public const string GetContinuous = "get_continuous";
|
||||
public const string SetContinuous = "set_continuous";
|
||||
|
||||
public const string GetGrowthTime = "get_growth_time";
|
||||
public const string SetGrowthTime = "set_growth_time";
|
||||
|
||||
public const string GetDuration = "get_duration";
|
||||
public const string SetDuration = "set_duration";
|
||||
|
||||
public const string GetDecayTime = "get_decay_time";
|
||||
public const string SetDecayTime = "set_decay_time";
|
||||
|
||||
public const string GetNoiseEmitterLayer = "get_noise_emitter_layer";
|
||||
public const string SetNoiseEmitterLayer = "set_noise_emitter_layer";
|
||||
|
||||
public const string SetNoiseEmitterLayerValue = "set_noise_emitter_layer_value";
|
||||
|
||||
public const string Emit = "emit";
|
||||
public const string IsEmitting = "is_emitting";
|
||||
public const string Stop = "stop";
|
||||
public const string Toggle = "toggle";
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
uid://btom8l3wlkn2j
|
@@ -0,0 +1,83 @@
|
||||
using Godot;
|
||||
|
||||
namespace PhantomCamera.Noise;
|
||||
|
||||
public class PhantomCameraNoiseEmitter3D(GodotObject node)
|
||||
{
|
||||
public Node3D Node3D = (Node3D)node;
|
||||
|
||||
public PhantomCameraNoise3D Noise
|
||||
{
|
||||
get => new((Resource)Node3D.Call(MethodName.GetNoise));
|
||||
set => Node3D.Call(MethodName.SetNoise, (GodotObject)value.Resource);
|
||||
}
|
||||
|
||||
public bool Continuous
|
||||
{
|
||||
get => (bool)Node3D.Call(MethodName.GetContinuous);
|
||||
set => Node3D.Call(MethodName.SetContinuous, value);
|
||||
}
|
||||
|
||||
public float GrowthTime
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetGrowthTime);
|
||||
set => Node3D.Call(MethodName.SetGrowthTime, value);
|
||||
}
|
||||
|
||||
public float Duration
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetDuration);
|
||||
set => Node3D.Call(MethodName.SetDuration, value);
|
||||
}
|
||||
|
||||
public float DecayTime
|
||||
{
|
||||
get => (float)Node3D.Call(MethodName.GetDecayTime);
|
||||
set => Node3D.Call(MethodName.SetDecayTime, value);
|
||||
}
|
||||
|
||||
public int NoiseEmitterLayer
|
||||
{
|
||||
get => (int)Node3D.Call(MethodName.GetNoiseEmitterLayer);
|
||||
set => Node3D.Call(MethodName.SetNoiseEmitterLayer, value);
|
||||
}
|
||||
|
||||
public void SetNoiseEmitterLayerValue(int layer, bool value) =>
|
||||
Node3D.Call(MethodName.SetNoiseEmitterLayerValue, layer, value);
|
||||
|
||||
public void Emit() => Node3D.Call(MethodName.Emit);
|
||||
|
||||
public bool IsEmitting() => (bool)Node3D.Call(MethodName.IsEmitting);
|
||||
|
||||
public void Stop() => Node3D.Call(MethodName.Stop);
|
||||
|
||||
public void Toggle() => Node3D.Call(MethodName.Toggle);
|
||||
|
||||
public static class MethodName
|
||||
{
|
||||
public const string GetNoise = "get_noise";
|
||||
public const string SetNoise = "set_noise";
|
||||
|
||||
public const string GetContinuous = "get_continuous";
|
||||
public const string SetContinuous = "set_continuous";
|
||||
|
||||
public const string GetGrowthTime = "get_growth_time";
|
||||
public const string SetGrowthTime = "set_growth_time";
|
||||
|
||||
public const string GetDuration = "get_duration";
|
||||
public const string SetDuration = "set_duration";
|
||||
|
||||
public const string GetDecayTime = "get_decay_time";
|
||||
public const string SetDecayTime = "set_decay_time";
|
||||
|
||||
public const string GetNoiseEmitterLayer = "get_noise_emitter_layer";
|
||||
public const string SetNoiseEmitterLayer = "set_noise_emitter_layer";
|
||||
|
||||
public const string SetNoiseEmitterLayerValue = "set_noise_emitter_layer_value";
|
||||
|
||||
public const string Emit = "emit";
|
||||
public const string IsEmitting = "is_emitting";
|
||||
public const string Stop = "stop";
|
||||
public const string Toggle = "toggle";
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
uid://buvda14filkjx
|
Reference in New Issue
Block a user