Example #1
0
    public void PlayCamcorderLoop(Transform target, bool onOff, string eventPath)
    {
        PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;

        if (this.CamcorderLoopInstance == null && onOff)
        {
            this.CamcorderLoopInstance = FMOD_StudioSystem.instance.GetEvent(eventPath);
        }
        if (this.CamcorderLoopInstance != null)
        {
            UnityUtil.ERRCHECK(this.CamcorderLoopInstance.getPlaybackState(out state));
        }
        if (onOff)
        {
            UnityUtil.ERRCHECK(this.CamcorderLoopInstance.set3DAttributes(target.to3DAttributes()));
            if (!state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderLoopInstance.start());
            }
        }
        else
        {
            if (state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderLoopInstance.stop(STOP_MODE.ALLOWFADEOUT));
            }
            this.CamcorderLoopInstance = null;
        }
    }
Example #2
0
    public void PlayCamcorderRewindLoop(Transform target, bool onOff)
    {
        PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;

        if (this.CamcorderRewindLoopInstance == null && onOff && this.CamcorderRewindLoopEvent != null)
        {
            this.CamcorderRewindLoopInstance = FMOD_StudioSystem.instance.GetEvent(this.CamcorderRewindLoopEvent);
        }
        if (this.CamcorderRewindLoopInstance != null)
        {
            UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.getPlaybackState(out state));
        }
        if (onOff)
        {
            UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.set3DAttributes(target.to3DAttributes()));
            this.SyncLoopingEvent(this.CamcorderRewindLoopEvent, target.position);
            if (!state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.start());
            }
        }
        else
        {
            this.SyncLoopingEvent(string.Empty, Vector3.zero);
            if (state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.stop(STOP_MODE.IMMEDIATE));
            }
            this.CamcorderRewindLoopInstance = null;
        }
    }
Example #3
0
 private void Update()
 {
     if (this.playerSightedInstance != null)
     {
         PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;
         if (this.playerSightedInstance.getPlaybackState(out state) == RESULT.OK && state.isPlaying())
         {
             UnityUtil.ERRCHECK(this.playerSightedInstance.set3DAttributes(base.transform.to3DAttributes()));
         }
         else
         {
             this.playerSightedInstance = null;
         }
     }
 }