Skip to content

Instantly share code, notes, and snippets.

@hhyyg
Created May 2, 2022 06:43
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 hhyyg/86d28ffeb94bd934fb8520f0f1fc9b82 to your computer and use it in GitHub Desktop.
Save hhyyg/86d28ffeb94bd934fb8520f0f1fc9b82 to your computer and use it in GitHub Desktop.
CRI ADX2, Unity で再生時間(GetTimeSyncedWithAudio)を取得する。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BgmController : MonoBehaviour
{
//private CriAtomSource criAtomSource;
private CriAtomExPlayback playback;
private CriAtomExPlayer criAtomExPlayer;
void Start()
{
this.criAtomExPlayer = new CriAtomExPlayer(true);
this.criAtomExPlayer.SetCue(CriAtom.GetCueSheet("CueSheet_0").acb, "Fatyjy(Cue Name)");
this.playback = this.criAtomExPlayer.Start();
}
void Update()
{
Debug.Log(this.playback.GetTimeSyncedWithAudio());
}
public void BassSliderOnValueChange(float newSliderValue)
{
this.criAtomExPlayer.SetAisacControl("BassControl", newSliderValue);
this.criAtomExPlayer.Update(this.playback);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment