Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sukedon
Last active November 21, 2015 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sukedon/9e794ed33707a46da5a0 to your computer and use it in GitHub Desktop.
Save sukedon/9e794ed33707a46da5a0 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class AnimationClipController : MonoBehaviour {
[Header("再生するanimationが入っているAnimatorを指定"),SerializeField]
private Animator targetAnimator;
[Header("再生したいanimationState名(animator上で確認)"),SerializeField]
private string targetAnimationStateName;
void GotoAndPlay(string targetTime){
if (string.IsNullOrEmpty(targetTime)) return;
//文字を:で分割
string[] splittedTargetTime = targetTime.Split(':');
int second = int.Parse(splittedTargetTime[0]);
int milliSecond = int.Parse(splittedTargetTime[1]);
float targetFrame = second + (float) milliSecond/(float) 60;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment