Search Unity

iTween Ignore Scale Time

Discussion in 'Scripting' started by gregmax17, Mar 28, 2013.

  1. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    Here is my code when the game is paused:

    Code (csharp):
    1.  
    2. Time.timeScale = 0f;
    3.  
    4. Hashtable ht = new Hashtable();
    5. ht.Add("volume", 0.2f);
    6. ht.Add("time", 0.5f);
    7. ht.Add("ignoretimescale", true);
    8.  
    9. // down the audio
    10. iTween.AudioTo(Camera.main.gameObject, ht);
    11.  
    But the volume does not adjust... is this a bug? Whats a quick fix? Thanks!
     
  2. fanhieu8x

    fanhieu8x

    Joined:
    Dec 19, 2016
    Posts:
    4
    Same may problem, I've found a tip solution for that

    Here solution https://github.com/machiryo/itween/issues/127
    Using Patch file for it at: https://storage.googleapis.com/goog...mment-6/iTween.cs.delay-ignoreTimeScale.patch

    IEnumerator TweenDelay(){
    delayStarted = Time.time;
    - yield return new WaitForSeconds (delay);
    + if (useRealTime) { // wait frame-at-a-time for real time to pass (N.b. not yet integrated with Pause())
    + float delayStartedRealTime = Time.realtimeSinceStartup;
    + float resumeTimeRealTime = delayStartedRealTime + delay;
    + while (Time.realtimeSinceStartup < resumeTimeRealTime) {
    + yield return null;
    + }
    + lastRealTime = Time.realtimeSinceStartup; // compensate for delay for real-timers
    + } else {
    + yield return new WaitForSeconds (delay);
    + }
    if(wasPaused){
    wasPaused=false;
    TweenStart();