mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 22:29:18 +00:00
Use new API for 4.0
This commit is contained in:
@@ -117,8 +117,8 @@ and randomly choose one of the three animation types:
|
||||
public override void _Ready()
|
||||
{
|
||||
var animSprite2D = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
animSprite2D.Playing = true;
|
||||
string[] mobTypes = animSprite2D.Frames.GetAnimationNames();
|
||||
animSprite2D.Play();
|
||||
string[] mobTypes = animSprite2D.SpriteFrames.GetAnimationNames();
|
||||
animSprite2D.Animation = mobTypes[GD.Randi() % mobTypes.Length];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user