Exemplo n.º 1
0
        public void StopAllClips(bool pImmediately)
        {
            currentState = SMusicState.invalid;

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

            return(ac);
        }
Exemplo n.º 3
0
        public void StopAllClips(bool pImmediately)
        {
            currentState = SMusicState.invalid;

            if (mCurrentChannel != null)
            {
                Stop(mCurrentChannel, pImmediately);
            }
        }
Exemplo n.º 4
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;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 6
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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 8
0
 /// <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;
 }
Exemplo n.º 9
0
 public bool Equals(SMusicState pState)
 {
     return pState.mIndex == this.mIndex;
 }
Exemplo n.º 10
0
 AudioClip GetClipForState(SMusicState pState)
 {
     Debug.Log("Music requested: " + pState);
     AudioClip ac = pState.GetNextClip();
     return ac;
 }
Exemplo n.º 11
0
		/// <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;
		}
Exemplo n.º 12
0
		public bool Equals(SMusicState pState)
		{
			return pState.mIndex == this.mIndex;
		}