コード例 #1
0
    void ChangeMusic()
    {
        switch (currentScene.name)
        {
        //case "MainMenu":
        //    bgmEvent.Post(gameObject);
        //    return;
        case "SpaceShooter":
            bgmEvent.Stop(gameObject);
            Destroy(gameObject);
            return;

        default:
            return;
        }
    }
コード例 #2
0
    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();
    }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 private void OnDestroy()
 {
     AudioInputEvent.Stop(gameObject);
 }
コード例 #5
0
 public void StopEvent()
 {
     myEvent.Stop(gameObject);
 }
コード例 #6
0
 private void OnDisable()
 {
     EnemyMusicEvent.Stop(gameObject);
 }
コード例 #7
0
 public void PostAnnihilationWwiseEvent()
 {
     print("Play collision sound");
     Annihilation.Post(gameObject);
     ParticleMove.Stop(gameObject);
 }
コード例 #8
0
 public void StopSound()
 {
     m_PlayingID = AkSoundEngine.AK_INVALID_PLAYING_ID;
     MicrophoneEvent.Stop(gameObject);
 }
コード例 #9
0
 private void OnDestroy()
 {
     MusicEvent.Stop(gameObject);
     InputManager.OnMenuDown -= SkipCredits;
 }