Play button in editor
This commit is contained in:
parent
ad56c6f61f
commit
285b90f503
6 changed files with 38 additions and 5 deletions
19
addons/pvzadventure/scripts/AdventurePlayer.cs
Normal file
19
addons/pvzadventure/scripts/AdventurePlayer.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
|
||||
[Tool]
|
||||
public partial class AdventurePlayer : Node
|
||||
{
|
||||
const string tilesetUID = "uid://dd3yegl1xo44m";
|
||||
[Export] public string pathToLevel;
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
|
||||
CallDeferred("InitLevel");
|
||||
}
|
||||
private void InitLevel()
|
||||
{
|
||||
LevelController.Instance.StartLevel(ResourceLoader.Load<PackedScene>(tilesetUID), ResourceLoader.Load<AdventureLevelResource>(pathToLevel));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue