title: Access non static function from static function
body: <p>Here is some insight: I am working with UnityScript in Unity 4.6.3. I have one script called Pause.js and it contains this function: </p>
  
  <pre><code>function fadeMusicOut () {
      while (audio.volume &gt;= 0.005) {
      yield WaitForSeconds(0.1);
      Debug.Log("Loop Entered: " + audio.volume);
      audio.volume = (audio.volume - 0.015);
  }
  </code></pre>
  
  <p>Another script GameManager.js has this function:</p>
  
  <pre><code>static function Score (wallName : String) {
      if (wallName == "rightWall") {
          playerScore01 += 1;
      }
      else {
          playerScore02 += 1;
      }
      if (playerScore01 == SettingsBack.scoreLimit || playerScore02 == SettingsBack.scoreLimit)
      {
          startParticles = 1;
          SettingsBack.gameOver = 1;
          BallControl.fadeSound = 1;
          yield WaitForSeconds(4);
          Camera.main.SendMessage("fadeOut");
          Pause.fadeMusic = 1;
          SettingsBack.soundVolume = 0;
          yield WaitForSeconds(2);
          playerScore01 = 0;
          playerScore02 = 0;
          SettingsBack.soundVolume = oldSoundVol;
          Application.LoadLevel("_Menu");
      }
  }
  </code></pre>
  
  <p>So pretty much I want to call the <code>fadeMusicOut()</code> function from <code>static function Score</code>, but it will not let me because it says it needs an instance of that object.</p>
  
  <p>The Pause.js script is not attached to any game objects, but it is attached to 2 buttons that call their specific functions. The GameManager.js script is attached to an object called GM. So how can I go about calling <code>fadeMusicOut()</code> from the Score function?</p>
  
  <p>I have tried setting new vars that import the game object but still no luck. I tried making <code>fadeMusicOut()</code> a static function, but it creates many errors.</p>
  
  <p>Any help at all is appreciated.</p>