예제 #1
0
        /// <summary>
        /// Active the effect. (Script)
        /// </summary>
        public void Active()
        {
            mIsActive       = true;
            mTargetPosition = mTowardPosition;

            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mActiveClip);
        }
예제 #2
0
        /// <summary>
        /// Deactive the effect. (Script)
        /// </summary>
        public void Deactive()
        {
            mIsActive       = false;
            mTargetPosition = mRecordPosition;

            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mDeactiveClip);
        }
        /// <summary>
        /// Tween back to the starting position and play sound effect.
        /// </summary>
        public void Deactive()
        {
            if (!mOverrideTween)
            {
                if (!mTweenerHandler.IsAllDoneTweening())
                {
                    return;
                }
            }

            if (!this.mIsActive)
            {
                return;
            }

            mTweenerHandler.DoAllTweenToStartValue();
            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mDeactiveSound, JCS_SoundMethod.PLAY_SOUND_WHILE_NOT_PLAYING);

            if (mDeactiveCallbackFunc != null)
            {
                mDeactiveCallbackFunc.Invoke();
            }

            this.mIsActive = false;
        }
        /// <summary>
        /// Tween to the taget position and play sound effect.
        /// </summary>
        public void Active()
        {
            if (!mOverrideTween)
            {
                if (!mTweenerHandler.IsAllDoneTweening())
                {
                    return;
                }
            }

            if (this.mIsActive)
            {
                return;
            }

            mTweenerHandler.DoAllTweenToTargetValue();
            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mActiveSound, JCS_SoundMethod.PLAY_SOUND_WHILE_NOT_PLAYING);

            if (mPanelRoot != null)
            {
                mPanelRoot.Show(true);
            }

            if (mActiveCallbackFunc != null)
            {
                mActiveCallbackFunc.Invoke();
            }

            this.mIsActive = true;
        }
예제 #5
0
 /// <summary>
 /// Hide the canvas so it's invisible.
 /// </summary>
 public void Hide(bool mute = false)
 {
     mCanvas.enabled = false;
     if (!mute)
     {
         JCS_SoundPlayer.PlayByAttachment(mActiveSound, JCS_SoundMethod.PLAY_SOUND);
     }
 }
예제 #6
0
 /// <summary>
 /// Show the canvas so it's visible.
 /// </summary>
 public void Show(bool mute = false)
 {
     mCanvas.enabled = true;
     if (!mute)
     {
         JCS_SoundPlayer.PlayByAttachment(mDeactiveSound, JCS_SoundMethod.PLAY_SOUND);
     }
 }
예제 #7
0
        /// <summary>
        /// Play shake sound.
        /// </summary>
        private void PlayeSound()
        {
            if (mShakeSound == null)
            {
                return;
            }

            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mShakeSound);
        }
예제 #8
0
        /// <summary>
        /// Hide the dialogue in the game.
        /// </summary>
        public override void Hide(bool mute = false)
        {
            base.Hide(mute);

            RemoveFromOpenWindowList();

            if (!mute)
            {
                JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mCloseWindowClip, JCS_SoundMethod.PLAY_SOUND);
            }
        }
예제 #9
0
        /// <summary>
        /// Show the dialogue in the game.
        ///
        /// NOTE(jenchieh): this will play the default sound.
        /// </summary>
        public void ShowDialogue()
        {
            ShowDialogueWithoutSound();

            // set focus dialogue
            if (DialogueType == JCS_DialogueType.PLAYER_DIALOGUE)
            {
                JCS_UIManager.instance.SetJCSDialogue(JCS_DialogueType.PLAYER_DIALOGUE, this);
            }

            // let UIManager know the window is opened
            SwapToTheLastOpenWindowList();

            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mOpenWindowClip, JCS_SoundMethod.PLAY_SOUND);
        }
예제 #10
0
        /// <summary>
        /// Show the dialogue in the game.
        /// </summary>
        public override void Show(bool mute = false)
        {
            base.Show(mute);

            // set focus dialogue
            if (DialogueType == JCS_DialogueType.PLAYER_DIALOGUE)
            {
                JCS_UIManager.instance.SetDialogue(JCS_DialogueType.PLAYER_DIALOGUE, this);
            }

            // let UIManager know the window is opened
            SwapToTheLastOpenWindowList();

            if (!mute)
            {
                JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mOpenWindowClip, JCS_SoundMethod.PLAY_SOUND);
            }
        }
예제 #11
0
        private void Update()
        {
            if (!mStartDelay)
            {
                return;
            }

            mDelayTimer += Time.deltaTime;

            if (mDelayTime < mDelayTimer)
            {
                // switch scene.
                SwitchScene();

                // play sound.
                JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mSlideScreenSound);

                // reset timer (ready for next use)
                mDelayTimer = 0;

                // disable delay (ready for next use)
                mStartDelay = false;
            }
        }
예제 #12
0
        /// <summary>
        /// Hide the dialogue in the game.
        ///
        /// NOTE(jenchieh): this will play the defualt sound.
        /// </summary>
        public void HideDialogue()
        {
            HideDialogueWithoutSound();

            JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mCloseWindowClip, JCS_SoundMethod.PLAY_SOUND);
        }
 /// <summary>
 /// Play the button click sound.
 /// </summary>
 private void PlayButtonClickSound()
 {
     JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mButtonClickSound, mSoundMethod);
 }