mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 14:53:47 +00:00
Spawn markers in editor
This commit is contained in:
parent
82f4c75ad7
commit
479df3c7c4
8 changed files with 150 additions and 76 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Utils;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
|
|
@ -52,6 +53,26 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
|
||||
private EnemyProxy3D _spawnedEnemy;
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
{
|
||||
//GroupName = (string)props["targetname"];
|
||||
this.AddToGroup("EnemyMarkers");
|
||||
AutoSpawn = props["autospawn"].AsBool();
|
||||
|
||||
var scriptPath = props["resource_path"].AsString();
|
||||
if (!string.IsNullOrWhiteSpace(scriptPath))
|
||||
{
|
||||
Enemy = GD.Load<EnemyResource>(scriptPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
GD.PushWarning($"Spawner {this.Name} has no enemy assigned");
|
||||
}
|
||||
|
||||
Billboard = true;
|
||||
//MarkerId = props["id"].AsInt32();
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue