public void StopAllClips(bool pImmediately)
        {
            currentState = SMusicState.invalid;

            if(mCurrentChannel != null)
                Stop(mCurrentChannel, pImmediately);
        }
Exemple #2
0
        AudioClip GetClipForState(SMusicState pState)
        {
            Debug.Log("Music requested: " + pState);
            AudioClip ac = pState.GetNextClip();

            return(ac);
        }
Exemple #3
0
        public void StopAllClips(bool pImmediately)
        {
            currentState = SMusicState.invalid;

            if (mCurrentChannel != null)
            {
                Stop(mCurrentChannel, pImmediately);
            }
        }
        public void PlayClip(SMusicState pState)
        {
            if(currentState != pState)
            {
                Debug.Log("GameMusic: " + pState);

                AudioClip _requestedClip  = GetClipForState(pState);
                if(mCurrentChannel != null)
                {
                    Stop (mCurrentChannel, false);
                }
                mCurrentChannel = Play(_requestedClip, true);
                currentState = pState;
            }
        }
Exemple #5
0
        public void PlayClip(SMusicState pState)
        {
            if (currentState != pState)
            {
                Debug.Log("GameMusic: " + pState);

                AudioClip _requestedClip = GetClipForState(pState);
                if (mCurrentChannel != null)
                {
                    Stop(mCurrentChannel, false);
                }
                mCurrentChannel = Play(_requestedClip, true);
                currentState    = pState;
            }
        }
        void Start()
        {
            currentState = SMusicState.invalid;

            if(mInitialized)
                return;
            #if UNITY_ANDROID
            Init(1);
            #else
            Init (3);
            #endif
            FadeDuration = mFadeTime;

            mInitialized = true;
            UGB.Options.OnAnyOptionChanged += OnAnyOptionChangedEvent;
        }
Exemple #7
0
        void Start()
        {
            currentState = SMusicState.invalid;

            if (mInitialized)
            {
                return;
            }
        #if UNITY_ANDROID
            Init(1);
        #else
            Init(3);
        #endif
            FadeDuration = mFadeTime;

            mInitialized = true;
            UGB.Options.OnAnyOptionChanged += OnAnyOptionChangedEvent;
        }
 /// <summary>
 /// Add a new Music State to the central music state system. You can add clips to the returns instance. 
 /// </summary>
 /// <param name="pIndex">index.</param>
 /// <param name="pName">name.</param>
 /// <returns>The static instance for the given index. </returns>
 public static SMusicState Add(int pIndex, string pName)
 {
     var state = new SMusicState(pIndex, pName);
     mStates[pIndex] = state;
     return state;
 }
 public bool Equals(SMusicState pState)
 {
     return pState.mIndex == this.mIndex;
 }
 AudioClip GetClipForState(SMusicState pState)
 {
     Debug.Log("Music requested: " + pState);
     AudioClip ac = pState.GetNextClip();
     return ac;
 }
		/// <summary>
		/// Add a new Music State to the central music state system. You can add clips to the returns instance. 
		/// </summary>
		/// <param name="pIndex">index.</param>
		/// <param name="pName">name.</param>
		/// <returns>The static instance for the given index. </returns>
		public static SMusicState Add(int pIndex, string pName)
		{
			var state = new SMusicState(pIndex, pName);
			mStates[pIndex] = state;
			return state;
		}
		public bool Equals(SMusicState pState)
		{
			return pState.mIndex == this.mIndex;
		}