Inheritance: MonoBehaviour
Esempio n. 1
0
 void Start()
 {
     staticRef   = this;
     crossAmount = 1f;
     initialVolA = musicA.volume;
     initialVolB = musicB.volume;
 }
Esempio n. 2
0
 void Awake()
 {
     if (crossfade == null)
     {
         crossfade = GameObject.FindObjectOfType <Crossfade> ();
     }
 }
Esempio n. 3
0
        public override int GetHashCode()
        {
            // Use a different bit for bool fields: bool.GetHashCode() will return 0 (false) or 1 (true). So we would
            // end up having the same hash code for e.g. two instances where one has only noCache set and the other
            // only noStore.
            var result = Autoplay.GetHashCode()
                         ^ (Crossfade.GetHashCode() << 1); // increase shift by one for every bool field

            if (CurrentSlide != null)
            {
                result ^= CurrentSlide.GetHashCode();
            }

            return(result);
        }
 void Awake()
 {
     Crossfade.instance = this;
     if (SoundManager.instance.AudioOn)
     {
         if (SoundManager.instance.SFXOn)
         {
             if (Application.loadedLevelName == "LevelBase")
             {
                 Crossfade.instance.ForestAmbient.Play();
             }
             else if (Application.loadedLevelName == "TitleScreen")
             {
                 Crossfade.instance.ReflectionTreeAmbient.Play();
             }
         }
         if (SoundManager.instance.BGMOn)
         {
             if (Application.loadedLevelName == "LevelBase")
             {
                 Crossfade.instance.ForestBGM.Play();
             }
             else if (Application.loadedLevelName == "TitleScreen")
             {
                 // I sure hope we get menu music sometime.
             }
         }
     }
 }