mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Textures and mapping
This commit is contained in:
parent
4e424fd526
commit
92062cd559
33 changed files with 1791 additions and 840 deletions
|
|
@ -1,8 +1,11 @@
|
|||
using System.Threading;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Cirno.Scripts.Components.FSM;
|
||||
using Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using GTweensGodot.Extensions;
|
||||
|
||||
namespace Cirno.Scripts.Activables._3D;
|
||||
|
|
@ -17,6 +20,8 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
public bool IsPrimed { get; private set; }
|
||||
|
||||
[Export] public Teleporter3D Target { get; set; }
|
||||
[Export] public string TargetGroup { get; set; }
|
||||
[Export] public string TargetName { get; set; }
|
||||
|
||||
[Export] public float ParticleEmitTime { get; private set; } = 2f;
|
||||
|
||||
|
|
@ -29,6 +34,14 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
|
||||
[Export] public StringName DefaultAnimationName { get; private set; } = "Default";
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary<string, string> props)
|
||||
{
|
||||
TargetGroup = props["target"];
|
||||
|
||||
TargetName = props["targetname"];
|
||||
IsEnabled = bool.Parse(props["enabled"]);
|
||||
}
|
||||
|
||||
private void PlayAnimation(StringName name)
|
||||
{
|
||||
}
|
||||
|
|
@ -49,6 +62,10 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
|
||||
if (Engine.IsEditorHint()) return;
|
||||
|
||||
if (!string.IsNullOrEmpty(TargetName))
|
||||
{
|
||||
this.AddToGroup(TargetName);
|
||||
}
|
||||
|
||||
IsPrimed = true;
|
||||
StopParticles();
|
||||
|
|
@ -137,7 +154,22 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
|
||||
protected virtual async Task Teleport(IsoPlayerStateMachine player)
|
||||
{
|
||||
if (Target is null) return;
|
||||
if (Target is null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(TargetGroup))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var foundTarget = GetTree().GetNodesInGroup(TargetGroup).FirstOrDefault();
|
||||
if (foundTarget is not Teleporter3D teleporterTarget)
|
||||
{
|
||||
GD.Print($"No target for teleportation found with group {TargetGroup}");
|
||||
return;
|
||||
}
|
||||
Target = teleporterTarget;
|
||||
|
||||
};
|
||||
//player.RequestMovementDisable(true);
|
||||
player.SetState(PlayerState.Cutscene);
|
||||
|
||||
|
|
@ -155,7 +187,7 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
await Task.Delay((int)(TeleportAnimationLength * 1000));
|
||||
|
||||
Target.PrepareForReceiving();
|
||||
player.MainObject.GlobalPosition = Target.GlobalPosition + TeleportOffset;
|
||||
player.MainObject.GlobalPosition = Target.GlobalPosition + TeleportOffset;
|
||||
Target.PlayTeleportEndSound();
|
||||
//await player.UnTeleport();
|
||||
|
||||
|
|
@ -168,12 +200,10 @@ public partial class Teleporter3D : StaticBody3D, IActivable
|
|||
|
||||
public void PlayTeleportStartSound()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void PlayTeleportEndSound()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected async Task TweenPlayer(CharacterBody3D player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue