void ChangeMusic() { switch (currentScene.name) { //case "MainMenu": // bgmEvent.Post(gameObject); // return; case "SpaceShooter": bgmEvent.Stop(gameObject); Destroy(gameObject); return; default: return; } }
IEnumerator ChargeTowardsPlayer(float seconds) { //print(Time.realtimeSinceStartup + ": ChargeTowardsPlayer"); TelegraphSound.Stop(gameObject, 0, AkCurveInterpolation.AkCurveInterpolation_Linear); ChargeSound.Post(gameObject); PlaySound(ChargeSoundClip); Vector3 currentPosition = transform.position; Vector3 destination = targetLocation + ((targetLocation) - currentPosition).normalized * 2f; for (float t = 0; t < 1; t += Time.deltaTime / seconds) { float s = Curves.Instance.SmoothOut.Evaluate(t); Vector3 nextPosition = Vector3.Lerp(currentPosition, destination, s); transform.position = nextPosition; yield return(null); } ReenableMovement(); }
public void TryFix(Pickup item) { if (!item.HasNameDiscovered()) { GameNotificationHandler.SendGameNotification(item.GameNotificationData()); } if (item.CheckType() == correctItem) { SoundManager.PlayEvent(AKID.EVENTS.ITEM_PORT_POSITIVE, gameObject); ambientFixedEvent.Post(gameObject); ambientBrokenEvent.Stop(gameObject, 100); Fix(); } else { SoundManager.PlayEvent(AKID.EVENTS.ITEM_PORT_NEGATIVE, gameObject); BreakOtherRooms(); } }
private void OnDestroy() { AudioInputEvent.Stop(gameObject); }
public void StopEvent() { myEvent.Stop(gameObject); }
private void OnDisable() { EnemyMusicEvent.Stop(gameObject); }
public void PostAnnihilationWwiseEvent() { print("Play collision sound"); Annihilation.Post(gameObject); ParticleMove.Stop(gameObject); }
public void StopSound() { m_PlayingID = AkSoundEngine.AK_INVALID_PLAYING_ID; MicrophoneEvent.Stop(gameObject); }
private void OnDestroy() { MusicEvent.Stop(gameObject); InputManager.OnMenuDown -= SkipCredits; }