Modifier frenzy
This commit is contained in:
parent
e9f230d4cc
commit
e8cb681103
16 changed files with 198 additions and 143 deletions
17
scripts/entities/AnimationStatistics.cs
Normal file
17
scripts/entities/AnimationStatistics.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Godot;
|
||||
|
||||
public partial class AnimationStatistics : Node
|
||||
{
|
||||
[Export]
|
||||
private string animationName;
|
||||
[Export]
|
||||
private string trackToFind;
|
||||
private float invokationsPerSecond;
|
||||
public override void _Ready()
|
||||
{
|
||||
var animation = GetParent<AnimationPlayer>().GetAnimation(animationName);
|
||||
|
||||
var track_id = animation.FindTrack(trackToFind,Animation.TrackType.Method);
|
||||
invokationsPerSecond = animation.TrackGetKeyCount(track_id)/ animation.Length;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class EatingStatistics : Node
|
||||
{
|
||||
[Export]
|
||||
private string animationName;
|
||||
private float bitesPerSecond;
|
||||
public override void _Ready()
|
||||
{
|
||||
var animation = GetParent<AnimationPlayer>().GetAnimation(animationName);
|
||||
|
||||
var track_id = animation.FindTrack("../../Eatbox",Animation.TrackType.Method);
|
||||
bitesPerSecond = animation.TrackGetKeyCount(track_id)/ animation.Length;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue