Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created September 21, 2017 14: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 tsubaki/17d5590a10449eb2333e24f369c0591c to your computer and use it in GitHub Desktop.
Save tsubaki/17d5590a10449eb2333e24f369c0591c to your computer and use it in GitHub Desktop.
ITimeControlの例
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Timeline;
public class Rotation : MonoBehaviour, ITimeControl {
[SerializeField] Vector3 axis = Vector3.up;
[SerializeField] float speed = 1;
// 何度も呼ばれる
public void SetTime (double time)
{
transform.localRotation = Quaternion.AngleAxis (((float) time) * speed, axis);
}
// クリップ開始時に呼ばれる
public void OnControlTimeStart ()
{
}
// クリップから抜ける時に呼ばれる
public void OnControlTimeStop ()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment