27 lines
527 B
C#
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));
|
|
}
|
|
}
|
|
|
|
}
|