2025-05-13 19:22:01 +08:00

27 lines
527 B
C#

using System.Collections.Generic;
using System.ComponentModel;
using Godot;
using Godot.Bridge;
using Godot.NativeInterop;
[ScriptPath("res://Scripts/Envirioment/RandomAnimTime.cs")]
public partial class RandomAnimTime : Node
{
[Export(PropertyHint.None, "")]
private AnimationPlayer[] anims;
public override void _EnterTree()
{
CallDeferred("SetAnims");
}
private void SetAnims()
{
for (int i = 0; i < anims.Length; i++)
{
anims[i].Advance(Main.RandomRange(0, anims[i].CurrentAnimation.Length));
}
}
}