Last active
November 21, 2015 18:24
-
-
Save sukedon/9e794ed33707a46da5a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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