Reworked Domovoi kitchen animation and added AnimationStarter script
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class AnimationStarter : Node2D
|
||||
{
|
||||
[Export] private AnimationPlayer _animationPlayer;
|
||||
[Export] private string _animationName;
|
||||
[Export] private bool _repeatable = true;
|
||||
|
||||
private bool _played;
|
||||
|
||||
public void PlayAnimation()
|
||||
{
|
||||
if (_animationPlayer == null || string.IsNullOrEmpty(_animationName))
|
||||
return;
|
||||
|
||||
if (!_repeatable && _played)
|
||||
return;
|
||||
|
||||
_animationPlayer.Play(_animationName);
|
||||
_played = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://31p67cdowuw4
|
||||
Reference in New Issue
Block a user