TransitionTo() private method

private TransitionTo ( float timeToReach ) : void
timeToReach float
return void
 static public int TransitionTo(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Audio.AudioMixerSnapshot self = (UnityEngine.Audio.AudioMixerSnapshot)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         self.TransitionTo(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #2
0
 private void UnPause()
 {
     Time.timeScale = 1;
     current = levelMusic;
     LevelMusicSource.UnPause();
     current.TransitionTo(TransitionSeconds);
     StartCoroutine(PauseMusic(PauseMusicSource, current, TransitionSeconds * TimeWarpingFactor));
 }
コード例 #3
0
 private void TransitionToSnapshot(AudioMixerSnapshot snapshot, float timeToReach)
 {
   if ((UnityEngine.Object) snapshot == (UnityEngine.Object) null)
     throw new ArgumentException("null Snapshot passed to AudioMixer.TransitionToSnapshot of AudioMixer '" + this.name + "'");
   if ((UnityEngine.Object) snapshot.audioMixer != (UnityEngine.Object) this)
     throw new ArgumentException("Snapshot '" + snapshot.name + "' passed to AudioMixer.TransitionToSnapshot is not a snapshot from AudioMixer '" + this.name + "'");
   snapshot.TransitionTo(timeToReach);
 }
コード例 #4
0
		private void TransitionToSnapshot(AudioMixerSnapshot snapshot, float timeToReach)
		{
			if (snapshot == null || snapshot.audioMixer != this)
			{
				return;
			}
			snapshot.TransitionTo(timeToReach);
		}
コード例 #5
0
 private void Pause()
 {
     Time.timeScale = TimeWarpingFactor;
     current = pauseMusic;
     PauseMusicSource.UnPause();
     current.TransitionTo(TransitionSeconds * TimeWarpingFactor);
     StartCoroutine(RepauseLater(TransitionSeconds * TimeWarpingFactor));
     StartCoroutine(PauseMusic(LevelMusicSource, current, TransitionSeconds * TimeWarpingFactor));
 }
コード例 #6
0
 // Update is called once per frame
 void Update()
 {
     if (AIBlackboard.instance.PlayerNearEnemy(60))
     {
         battleSnapshot.TransitionTo(1f);
     }
     else
     {
         normalSnapshot.TransitionTo(2.8f);
     }
 }
コード例 #7
0
ファイル: rewind.cs プロジェクト: htw6174/LaborJam
    // Use this for initialization
    void Start()
    {
        myAudioMixer.SetFloat("sfxVol",0.75f);
        myAudioMixer.SetFloat("musicVol",0.75f);

        mainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
        myRewindSound = this.gameObject.GetComponent<AudioSource>();
        RewindSnap = myAudioMixer.FindSnapshot("Rewind");
        NormalSnap = myAudioMixer.FindSnapshot("Normal");
        NormalSnap.TransitionTo(.5f);
        StartCoroutine("record");
    }
コード例 #8
0
ファイル: AudioMixer.cs プロジェクト: randomize/VimConfig
 private void TransitionToSnapshot(AudioMixerSnapshot snapshot, float timeToReach)
 {
     if (snapshot == null)
     {
         throw new ArgumentException("null Snapshot passed to AudioMixer.TransitionToSnapshot of AudioMixer '" + base.name + "'");
     }
     if (snapshot.audioMixer != this)
     {
         string[] textArray1 = new string[] { "Snapshot '", snapshot.name, "' passed to AudioMixer.TransitionToSnapshot is not a snapshot from AudioMixer '", base.name, "'" };
         throw new ArgumentException(string.Concat(textArray1));
     }
     snapshot.TransitionTo(timeToReach);
 }
コード例 #9
0
 static public int TransitionTo(IntPtr l)
 {
     try {
         UnityEngine.Audio.AudioMixerSnapshot self = (UnityEngine.Audio.AudioMixerSnapshot)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         self.TransitionTo(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #10
0
 static public int TransitionTo(IntPtr l)
 {
     try {
         UnityEngine.Audio.AudioMixerSnapshot self = (UnityEngine.Audio.AudioMixerSnapshot)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         self.TransitionTo(a1);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
コード例 #11
0
    public void Transition(int music)
    {
        if (music == 1)
        {
            snapshot = snapshotTitle;
            snapshot.TransitionTo (1.5f);
        }

        else if (music == 2)
        {
            snapshot = snapshotCastle;
            snapshot.TransitionTo (1.5f);
        }
        else if (music == 3)
        {
            snapshot = snapshotWin;
            snapshot.TransitionTo (1.5f);
        }
        else if (music == 4)
        {
            snapshot = snapshotDeath;
            snapshot.TransitionTo (1.5f);
        }
    }
コード例 #12
0
    public void SetCameraView(CameraView newView)
    {
        // Debug.Log("Setting camera view: " + cameraView + " -> " + newView);

        /*  Debug.Log("SETTING " + cameraView + " " + newView);
         * if (cameraView == newView)
         * {
         * return;
         * }
         * Debug.Log("continuing..."); */

        // Guard against switching to actor-driven camera when there is no camera actor.
        // Shouldn't happen, but just to be safe.

        if (newView == CameraView.ActorDriven && actorDrivenCameraViewController.GetCameraActor() == null)
        {
            Debug.LogWarning("Can't switch to actor-driven camera. No camera actor.");
            return;
        }

        CameraView           oldView       = cameraView;
        CameraViewController oldController = cameraViewController;

        cameraView = newView;

        gbStage.SetInitialCameraMode((GameBuilderStage.CameraMode)cameraView);

        // Log how long user spent in previous mode
        if (lastSwitchTime > 0f)
        {
            float secondsSpent = Time.realtimeSinceStartup - lastSwitchTime;
            long  msSpent      = (long)(Mathf.FloorToInt(secondsSpent * 1000f));
            if (msSpent > 100)
            {
                Util.Log($"Spent {msSpent}ms in {oldView.ToString()}");
            }
        }
        lastSwitchTime = Time.realtimeSinceStartup;

        switch (cameraView)
        {
        case CameraView.ThirdPerson:
            cameraViewController = thirdPersonCameraViewController;
            break;

        case CameraView.FirstPerson:
            cameraViewController = fpsCameraViewController;
            break;

        case CameraView.Isometric:
            cameraViewController = isometricCameraViewController;
            break;

        case CameraView.ActorDriven:
            cameraViewController = actorDrivenCameraViewController;
            break;

        default:
            throw new System.Exception($"Unsupported CameraView: {cameraView}");
        }
        cameraViewController.SetCamera();

        if ((cameraView == CameraView.FirstPerson || cameraView == CameraView.ThirdPerson) &&
            (oldView == CameraView.FirstPerson || oldView == CameraView.ThirdPerson) &&
            oldController != null)
        {
            cameraViewController.SetLookRotation(oldController.GetLookRotation());
        }


        if (cameraView == CameraView.Isometric)
        {
            distantAudioMixSnapshot.TransitionTo(.1f);
        }
        else
        {
            closeAudioMixSnapshot.TransitionTo(.1f);
        }
    }
コード例 #13
0
ファイル: AudioManager.cs プロジェクト: Silcoish/AgeOfAnubis
 public void FadeMusic(AudioMixerSnapshot snap, float duration)
 {
     if (snap != null)
     {
         snap.TransitionTo(duration);
     }
 }
コード例 #14
0
 //Created this function to use to transition to various snapshots
 public void ToSnapshot(AudioMixerSnapshot snapshot, float time)
 {
     snapshot.TransitionTo (time);
 }