/// <summary> /// Active the effect. (Script) /// </summary> public void Active() { mIsActive = true; mTargetPosition = mTowardPosition; JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mActiveClip); }
/// <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; }
/// <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); } }
/// <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); } }
/// <summary> /// Play shake sound. /// </summary> private void PlayeSound() { if (mShakeSound == null) { return; } JCS_SoundPlayer.PlayByAttachment(mSoundPlayer, mShakeSound); }
/// <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); } }
/// <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); }
/// <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); } }
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; } }
/// <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); }