Отображение в редакторе при изменении экспортированных переменных, музыка на все дни, звуки дверей, NPC.
This commit is contained in:
parent
fec3f22665
commit
3c1619ee9f
47 changed files with 657 additions and 89 deletions
|
@ -2,7 +2,7 @@ using Godot;
|
|||
using System;
|
||||
using Godot.Collections;
|
||||
|
||||
|
||||
[Tool]
|
||||
public partial class NPC : Node2D
|
||||
{
|
||||
[Export] public string NPCName;
|
||||
|
@ -14,7 +14,7 @@ public partial class NPC : Node2D
|
|||
public override void _Ready()
|
||||
{
|
||||
_sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D");
|
||||
_sprite.SpriteFrames = Frames;
|
||||
if (Frames is not null) _sprite.SpriteFrames = Frames;
|
||||
_sprite.Play("default");
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,14 @@ public partial class NPC : Node2D
|
|||
{
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
if (Engine.IsEditorHint())
|
||||
{
|
||||
if (Frames is not null && _sprite.SpriteFrames != Frames) _sprite.SpriteFrames = Frames;
|
||||
}
|
||||
}
|
||||
|
||||
public void test()
|
||||
{
|
||||
if (_sprite.Animation == "walk")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue