void PlayerAiming() { if (!jumpCharging.IsPlaying()) { chargeSnapshot.Play(); } currentlyAiming = true; //Setting the aim art float aimRotation = -(Mathf.Atan2(input.playerAim.x, input.playerAim.y) * 180 / Mathf.PI); aim.eulerAngles = new Vector3(0, 0, aimRotation); //Building Jump Force jumpingForce += jumpingForceTimer; //Setting UI canon aim slider canonAimSlider.value = jumpingForce; //Setting bullet time Time.timeScale = timeSlowdown; Time.fixedDeltaTime = .02f * Time.timeScale; //FMOD Charge if (!jumpCharging.IsPlaying()) { jumpCharging.Play(); } jumpCharging.SetParameter("ChargeUp", (jumpingForce - jumpingForceMinMax.x / (jumpingForceMinMax.y - jumpingForceMinMax.x))); }
void PlayAudio() { if (!SE.IsPlaying()) { SE.Play(); } }
public void PlayerMove() { if (!playerMove.IsPlaying()) { playerMove.Play(); } }
private void CheckStatus() { if (rig.velocity.magnitude > 0f && !frictionSound.IsPlaying()) { frictionSound.Play(); } if (rig.velocity.magnitude <= 0f && frictionSound.IsPlaying()) { frictionSound.Stop(); } }
public int checkNoteInput() { if (Input.GetKeyDown(firstNoteInput)) { if (player.GetBool("viool") == false && grabAlto.IsPlaying() == false) { grabAlto.Play(); } player.SetBool("viool", true); alto.enabled = false; return(0); } if (Input.GetKeyDown(secondNoteInput)) { if (player.GetBool("viool") == false && grabAlto.IsPlaying() == false) { grabAlto.Play(); } player.SetBool("viool", true); alto.enabled = false; return(1); } if (Input.GetKeyDown(thirdNoteInput)) { if (player.GetBool("viool") == false && grabAlto.IsPlaying() == false) { grabAlto.Play(); } player.SetBool("viool", true); alto.enabled = false; return(2); } if (Input.GetKeyDown(fourthNoteInput)) { if (player.GetBool("viool") == false && grabAlto.IsPlaying() == false) { grabAlto.Play(); } player.SetBool("viool", true); alto.enabled = false; return(3); } return(-1); }
private void Update() { usedThisFrame = false; if (!isDrawn) { return; } if (AvatarInputHandler.main.IsEnabled() && Player.main.GetRightHandHeld() && !Player.main.IsSpikyTrapAttached()) { usedThisFrame = true; } if (!usedThisFrame) { firedOneShot = false; } fireSource.enabled = usedThisFrame; if (usedThisFrame && activeCuttingTarget && !sfx_laserLoop.IsPlaying()) { sfx_laserLoop.Play(); } else if (usedThisFrame && !firedOneShot && !sfx_laserLoop.IsPlaying()) { sfx_oneShot.Play(); firedOneShot = true; } else if (!usedThisFrame && fxIsPlaying) { StopLaserCuttingFX(); } else if (!usedThisFrame) { sfx_laserLoop.Stop(); } if (fxIsPlaying) { fxLight.intensity = Mathf.MoveTowards(fxLight.intensity, lightIntensity, Time.deltaTime * 25f); } UpdateTarget(); }
public void Interact() { ItemDependencies id = gameObject.GetComponent <ItemDependencies>(); if (id) { if (id.CheckDependency(Inventory.instance)) { sceneSwitcher.ActivateSceneSwitch(targetSceneBuildIndex); enterSound.Play(); Debug.Log("ENTER SOUND"); } else { if (denialVoiceLineAlternatives.Length > 0 && !denialVoiceLine.IsPlaying()) { int i = Random.Range(0, denialVoiceLineAlternatives.Length); denialVoiceLine.Play(); denialVoiceLine.SetParameter("Voice Line", denialVoiceLineAlternatives[i]); } } } else { enterSound.Play(); Debug.Log("ENTER SOUND"); sceneSwitcher.ActivateSceneSwitch(targetSceneBuildIndex); } }
public static void StopEvent(StudioEventEmitter audioEventEmitter) { if (audioEventEmitter.IsPlaying()) { audioEventEmitter.Stop(); } }
/// <summary> /// Play this emitter if it isn't already playing (avoid multiple instances triggering in eg. Update()). /// </summary> /// <param name="eventEmitter"></param> public static void PlayIfNotPlaying(this StudioEventEmitter eventEmitter) { if (!eventEmitter.IsPlaying()) { eventEmitter.Play(); } }
void OnClickFTUE(OnTapStepFTUE pEvent) { if (!_clickEmitter.IsPlaying()) { _clickEmitter.Play(); } }
public void Play() { if (!sound.IsPlaying()) { sound.Play(); } }
public void PlayMenuMusic() { if (gameBgm.IsPlaying()) { gameBgm.Stop(); menuBgm.Play(); } }
public void PlayGameMusic() { if (menuBgm.IsPlaying()) { menuBgm.Stop(); gameBgm.Play(); } }
public void Interact() { if (!see.IsPlaying()) { see.Play(); see.SetParameter("Voice Line", voiceLine); } }
/// <summary> /// Updates the master volume values and stores it. /// </summary> public void UpdateMasterVolume(float value) { masterBus.setVolume(value); if (!masterEmitter.IsPlaying() && Time.timeSinceLevelLoad > 3f) { masterEmitter.Play(); } GameMaster.Instance.MasterSaveData.audioMasterVolume = value; GameMaster.Instance.SaveGame(); }
public void OnCollisionEnter(Collision col) { if (col.relativeVelocity.magnitude > 8) { if (!emitterSource.IsPlaying()) { emitterSource.Play(); } } }
void Update() { if (hasParameter) { if (emitter.IsPlaying()) { parameter.setValue(ExtensionsManager.GetOcclusionAmout(transform.position)); } } }
public void OnJump(InputAction.CallbackContext context) { if (context.performed && IsGrounded) { if (!jumpEmitter.IsPlaying()) { jumpEmitter.Play(); } rb.AddForce(Vector3.up * 2, ForceMode.Impulse); } }
public static void ToggleEmitter(EmitterType emitterType) { StudioEventEmitter emitter = AudioManager.Instance.EventPaths.GetEmitter(emitterType); if (emitter.IsPlaying()) { emitter.Stop(); return; } emitter.Play(); }
private void Update() { if (GameManager.Instance.IsOnDialogue()) { return; } if (Input.GetKeyDown(KeyCode.Escape)) { if (stopped) { panel.SetActive(false); pausePanel.SetActive(true); optionsPanel.SetActive(false); stopped = false; if (!soundEmitter.IsPlaying()) { soundEmitter.Play(); } soundEmitter.EventInstance.setParameterByName("TimeON", 1); tm.Resume(); TimeEvent.Stop(); playerThrow.StopCasting(); } else { playerThrow.StopCasting(); panel.SetActive(true); stopped = true; if (!soundEmitter.IsPlaying()) { soundEmitter.Play(); } soundEmitter.EventInstance.setParameterByName("TimeON", 0); tm.Pause(); TimeEvent.Play(); } } }
void LateUpdate() { if (lastPosition == transform.position) { spiderStepEvent.Stop(); } else if (!spiderStepEvent.IsPlaying()) { spiderStepEvent.Play(); } lastPosition = transform.position; }
/// <summary> /// Triggers the chasing sounds /// </summary> public void CueMonsterChase() { BackgroundMusic.Stop(); chasingMonster++; if (!MonsterChaseMusic.IsPlaying()) { MonsterChaseMusic.Play(); } if (!SeenByMonster.IsPlaying()) { SeenByMonster.Play(); } }
private void Update() { if (velocity.x != 0 || velocity.y != 0) { if (!soundEvent.IsPlaying()) { soundEvent.Play(); } } else { soundEvent.Stop(); } }
void Awake() { cam = GetComponent <CinemachineVirtualCamera>(); emitter = transform.parent.gameObject.GetComponent <StudioEventEmitter>(); if (emitter == null) { emitter = transform.parent.gameObject.AddComponent <StudioEventEmitter>(); } emitter.Event = FModStrings.Music; if (!emitter.IsPlaying()) { emitter.Play(); } }
// Update is called once per frame void Update() { platformTrans = transform.parent; if (platformTrans.hasChanged) { Debug.Log("Transform changed"); platformTrans.hasChanged = false; } if (platformTrans.hasChanged == false && !target.IsPlaying()) { Debug.Log("playing sound"); target.Play(); } }
public void GameOver() { gameOver = true; Time.timeScale = 1; gameOverUI.SetActive(true); player.SetActive(false); if (!deadSound.IsPlaying()) { deadSound.Play(); } Cursor.lockState = CursorLockMode.None; Cursor.visible = true; }
void Awake() { if (cameraText == null) { Debug.LogError("Missing reference to camera text UI"); } cam = GetComponent <CinemachineVirtualCamera>(); emitter = transform.parent.gameObject.GetComponent <StudioEventEmitter>(); if (emitter == null) { emitter = transform.parent.gameObject.AddComponent <StudioEventEmitter>(); } emitter.Event = FModStrings.Music; if (!emitter.IsPlaying()) { emitter.Play(); } }
public void Interact() { if (fireplace.HasLitten) { Camera.main.gameObject.GetComponent <CameraController>().CutsceneLock = true; player.GetComponent <CharacterMovement>().CutsceneLock = true; GameObject temp = Instantiate(cutsceneToTrigger); player.transform.parent = temp.transform; temp.SetActive(true); } else { if (!see.IsPlaying()) { //cant sleep its too cold voicelines int id = Random.Range(0, voiceLineIds.Count); see.Play(); see.SetParameter("Voice Line", voiceLineIds[id]); } } }
public static void _playSoundDo(string eventName, GameObject voicer = null) { StudioEventEmitter studioEvent = null; if (!voicer) { var eventNameGo = eventName.Replace('/', '_'); studioEvent = _root.FindChild <StudioEventEmitter>(eventNameGo, false); if (!studioEvent) { var go = new GameObject(eventNameGo); go.name = eventNameGo; go.transform.SetParent(_root.transform); go.transform.localPosition = Vector3.zero; studioEvent = go.GetMissComponent <StudioEventEmitter>(); studioEvent.OverrideAttenuation = true; studioEvent.OverrideMaxDistance = int.MaxValue; studioEvent.OverrideMinDistance = int.MaxValue; studioEvent.SetVolume(Volume_Music); } } else { studioEvent = voicer.GetMissComponent <StudioEventEmitter>(); if (studioEvent.IsPlaying()) { studioEvent.Stop(); } studioEvent.OverrideAttenuation = true; studioEvent.OverrideMaxDistance = 20; studioEvent.OverrideMinDistance = 3; studioEvent.SetVolume(Volume_Music); if (!_3dstudioEventList.Contains(studioEvent)) { _3dstudioEventList.Add(studioEvent); } } studioEvent.Event = eventName; studioEvent.Play(); }
void Update() { if (Input.GetKeyDown(KeyCode.Space)) { records.Clear(); emiter.Play(); int len; emiter.EventDescription.getLength(out len); audioLen = len / 1000.0f; Debug.Log(len); FMOD.SPEAKERMODE mode; int raw; RuntimeManager.CoreSystem.getSoftwareFormat(out rate, out mode, out raw); records.Clear(); } if (emiter.IsPlaying()) { recognizeResult = runtimeRecognizer.RecognizeByAudioSource(m_FFTDsp, rate); RecordingFmod(recognizeResult); UpdateForward(); } else if (records.Count > 0) { if (save) { OutputRecd(); } records.Clear(); #if UNITY_EDITOR if (save) { AssetDatabase.Refresh(); Debug.Log("output recd finish"); } #endif } }