mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 07:25:53 +00:00
Tutorial
This commit is contained in:
parent
8c3ed1f7c7
commit
b07a8fe60d
33 changed files with 594 additions and 58 deletions
21
Scripts/Resources/Events/CameraTargetEvent.cs
Normal file
21
Scripts/Resources/Events/CameraTargetEvent.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Resources.Events;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class CameraTargetEvent : CameraTargetPlayerEvent
|
||||
{
|
||||
[Export]
|
||||
public NodePath Target { get; private set; }
|
||||
|
||||
[Export]
|
||||
public Vector2 Offset { get; private set; }
|
||||
|
||||
public override void Start(Node2D parent)
|
||||
{
|
||||
GameManager.Instance.CameraTargetObject(parent.GetNode<Node2D>(Target), Offset);
|
||||
_isComplete = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
30
Scripts/Resources/Events/CameraTargetPlayerEvent.cs
Normal file
30
Scripts/Resources/Events/CameraTargetPlayerEvent.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Resources.Events;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class CameraTargetPlayerEvent : EventResource
|
||||
{
|
||||
protected bool _isComplete = false;
|
||||
|
||||
public override void Init(Node2D parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Start(Node2D parent)
|
||||
{
|
||||
GameManager.Instance.CameraTargetPlayer();
|
||||
_isComplete = true;
|
||||
}
|
||||
|
||||
public override void UpdateEvent(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool IsComplete()
|
||||
{
|
||||
return _isComplete;
|
||||
}
|
||||
}
|
||||
38
Scripts/Resources/Events/WaitEvent.cs
Normal file
38
Scripts/Resources/Events/WaitEvent.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Resources.Events;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class WaitEvent : EventResource
|
||||
{
|
||||
[Export(PropertyHint.None, "suffix:s")]
|
||||
public float WaitTime { get; set; }
|
||||
protected bool _isComplete = false;
|
||||
|
||||
public override void Init(Node2D parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Start(Node2D parent)
|
||||
{
|
||||
_ = Wait();
|
||||
}
|
||||
|
||||
private async Task Wait()
|
||||
{
|
||||
await Task.Delay((int)(WaitTime)*1000);
|
||||
_isComplete = true;
|
||||
}
|
||||
|
||||
public override void UpdateEvent(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool IsComplete()
|
||||
{
|
||||
return _isComplete;
|
||||
}
|
||||
}
|
||||
10
Scripts/Resources/Events/tsconfig.json
Normal file
10
Scripts/Resources/Events/tsconfig.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue