Skip to content

Instantly share code, notes, and snippets.

View JulianDeclercq's full-sized avatar

Joolean JulianDeclercq

View GitHub Profile
@JulianDeclercq
JulianDeclercq / Imdb fetch name by id
Last active December 16, 2023 18:39
Imdb fetch name by id
internal abstract class Program
{
private static readonly string[] Ids =
{
"nm0636046", "nm0000228", "tt2310332", "tt0113986", "tt0111191", "tt0117705", "tt0120735", "tt0107616",
"tt2058673", "tt0167261", "tt0167404", "tt0069280", "tt0151804", "nm0000142", "tt7829914", "tt5446858",
"tt3748528", "tt5164214", "tt0100122", "tt0088611", "tt0488085", "tt5149528", "tt0416320", "tt0400435",
"tt0091635", "tt3460252"
};
@JulianDeclercq
JulianDeclercq / Wait (in coroutine) until current animation is finished
Created June 26, 2017 14:56
Wait (in coroutine) until current animation is finished
AnimatorStateInfo animationState = myAnimator.GetCurrentAnimatorStateInfo(0);
AnimatorClipInfo[] animatorClipInfoArray = myAnimator.GetCurrentAnimatorClipInfo(0);
if (animatorClipInfoArray.Length > 0)
{
float clipLength = animatorClipInfoArray[0].clip.length;
float timePlayed = clipLength * animationState.normalizedTime;
float timeToDelay = clipLength - timePlayed;
yield return new WaitForSeconds(timeToDelay);
}