Example #1
0
 void OnSwinBoth(AnimationEvent animationEvent)
 {
     if (!IsSwimSoundValid())
     {
         return;
     }
     if (m_SwinBothEvent != null && CheckAnimationThreshold(animationEvent, m_WalkEventThreshold))
     {
         m_SwinBothEvent.Post(gameObject);
     }
     m_CharacterEntity.OnSwimBoth();
 }
Example #2
0
 public void PostGroundingUpdate(float deltaTime)
 {
     // Handle landing and leaving ground
     if (Motor.GroundingStatus.IsStableOnGround && !Motor.LastGroundingStatus.IsStableOnGround)
     {
         OnLanded();
         jump.Post(gameObject);
     }
     else if (!Motor.GroundingStatus.IsStableOnGround && Motor.LastGroundingStatus.IsStableOnGround)
     {
         OnLeaveStableGround();
     }
 }
Example #3
0
    public override void HandleEvent(UnityEngine.GameObject in_gameObject)
    {
        var gameObj = useOtherObject && in_gameObject != null ? in_gameObject : gameObject;

        soundEmitterObject = gameObj;

        if (enableActionOnEvent)
        {
            data.ExecuteAction(gameObj, actionOnEventType, (int)transitionDuration * 1000,
                               curveInterpolation);
            return;
        }

        if (m_callbackData != null)
        {
            playingId = data.Post(gameObj, (uint)m_callbackData.uFlags, Callback);
        }
        else
        {
            playingId = data.Post(gameObj);
        }
    }
Example #4
0
 /// <summary>
 /// Calls the Wwise event
 /// </summary>
 /// <param name="caller">The game object calling the event</param>
 public void PostWwiseEvent(GameObject caller)
 {
     // post wwise event
     if (wwiseEvent.IsValid())
     {
         Debug.Log(wwiseEvent);
         wwiseEvent.Post(caller);
     }
     // audio not yet created
     else
     {
         Debug.LogWarning("Warning: missing audio for audio event: " + name);
     }
 }
        private void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;

            PlayMusicEvent.Post(gameObject);

            DontDestroyOnLoad(this);
        }
Example #6
0
 public void PlayPlayerVoice(GameObject go, AK.Wwise.Event voice)
 {
     if (GameManager.Instance.config.soundActive.voice ||
         GameManager.Instance.config.soundActive.all)
     {
         try
         {
             voice.Post(go);
         }
         catch
         {
             MCSoundManager.LoadBank();
         }
     }
 }
Example #7
0
        private void Start()
        {
            if (!musicInitialized)
            {
                MusicStartEvent.Post(gameObject);
                musicInitialized = true;
            }
            else
            {
                ExploreMusicState.SetValue();
            }

            EventManager.AddListener <PlayerDiedEvent>(HandlePlayerDiedEvent);
            EventManager.AddListener <GameStartedEvent>(HandleGameStartedEvent);
        }
Example #8
0
        public void Action()
        {
            if (bullets > 0)
            {
                //play shoot animation

                shootSoundEvent.Post(AudioManager.ins.gameObject);

                //instantiate particles

                GameObject bulletIns = Instantiate(bulletPrefab, GameManager.ins.cam.position + GameManager.ins.cam.forward * 2, GameManager.ins.cam.rotation);
                bulletIns.GetComponent <Bullet>().direction = GameManager.ins.cam.forward;
                bullets--;
            }
        }
Example #9
0
 public void PlayBGM(GameObject go, AK.Wwise.Event bgm)
 {
     if (GameManager.Instance.config.soundActive.bgm &&
         GameManager.Instance.config.soundActive.all)
     {
         try
         {
             bgm.Post(go);
         }
         catch
         {
             MCSoundManager.LoadBank();
         }
     }
 }
Example #10
0
 public void PlayAmbient(GameObject go, AK.Wwise.Event amb)
 {
     if (GameManager.Instance.config.soundActive.ambient ||
         GameManager.Instance.config.soundActive.all)
     {
         try
         {
             amb.Post(go);
         }
         catch
         {
             MCSoundManager.LoadBank();
         }
     }
 }
Example #11
0
        public void takeDamage()
        {
            uint result;

            // Posts event, but waits for endOfEvent callback before being able to post again
            if (!isPlaying)
            {
                result = m_damageEvent.Post(gameObject, m_damageCallbackFlag, EventCallback, null);

                if (result != 0)
                {
                    isPlaying = true;
                }
            }
        }
    private bool PostEvent()
    {
        fadeinTriggered = fadeoutTriggered = false;

        uint playingID;

#if UNITY_EDITOR
        if (!CanPostEvents)
        {
            playingID = AkSoundEngine.AK_INVALID_PLAYING_ID;
        }
        else if (!UnityEditor.EditorApplication.isPlaying)
        {
            playingID = akEvent.Post(eventObject);
        }
        else
#endif
        {
            playingID = akEvent.Post(eventObject, CallbackFlags, CallbackHandler, null);
        }

        eventIsPlaying = playingID != AkSoundEngine.AK_INVALID_PLAYING_ID;
        return(eventIsPlaying);
    }
Example #13
0
 public void PlayPlayerSFX(GameObject go, AK.Wwise.Event sfx)
 {
     //Debug.Log("Play Player SFX : " + sfx.Name + MCSoundManager.SoundCall++);
     if (GameManager.Instance.config.soundActive.sfx ||
         GameManager.Instance.config.soundActive.all)
     {
         try
         {
             sfx.Post(go);
         }
         catch
         {
             MCSoundManager.LoadBank();
         }
     }
 }
Example #14
0
            public void PlaySound(GameObject go, AK.Wwise.Event bgm)
            {
                //Debug.Log(bgm.Name);

                if (GameManager.Instance.config.soundActive.sfx ||
                    GameManager.Instance.config.soundActive.all)
                {
                    try
                    {
                        bgm.Post(go);
                    }
                    catch
                    {
                        MCSoundManager.LoadBank();
                    }
                }
            }
        public void OnCreatureDeath(Vector2 position, Enemy.CreatureType type)
        {
            if (!CreatureIsVisible(position))
            {
                return;
            }

            if (type == Enemy.CreatureType.Scorpion)
            {
                ScorpionDeathEvent.Post(gameObject);
            }
            else if (type == Enemy.CreatureType.Spider)
            {
                SpiderDeathEvent.Post(gameObject);
            }
            else if (type == Enemy.CreatureType.Crawler)
            {
                Debug.Log("Crawler death");
                CrawlerDeathEvent.Post(gameObject);
            }
        }
Example #16
0
        protected void OnLanded()
        {
            _JustLanded = true;
            landSound.Post(gameObject);
            canChangedirection = true;
            jumpInitiated      = false;
            Debug.Log("Landed");

            if (CurrentCharacterState == PlayerStates.Idling || CurrentCharacterState == PlayerStates.Falling ||
                CurrentCharacterState == PlayerStates.Tired)
            {
                stopped = false;
                TransitionToState(PlayerStates.Running);
            }

            if (CurrentCharacterState == PlayerStates.Sliding)
            {
                //??
                _slideEndSpeed =
                    (Motor.GetDirectionTangentToSurface(Motor.Velocity, Motor.GroundingStatus.GroundNormal) *
                     Motor.Velocity.magnitude).magnitude;
                Debug.Log(_slideEndSpeed);
            }
        }
 public void OnCrawlerLaser()
 {
     CrawlerLaserEvent.Post(gameObject);
 }
 public void OnBossEmerge()
 {
     BossEmergeEvent.Post(gameObject);
 }
 public void OnHeal()
 {
     HealEvent.Post(gameObject);
 }
 public void OnPlayerPulse()
 {
     PulseEvent.Post(gameObject);
 }
 public void OnSwordHit()
 {
     SwordHitEvent.Post(gameObject);
 }
 public void OnSwordAttack()
 {
     SwordAttackEvent.Post(gameObject);
 }
 public void OnSwordAppear()
 {
     SwordAppearEvent.Post(gameObject);
 }
Example #24
0
 public void PlayVictory()
 {
     Victory.Post(gameObject);
 }
 public void OnButtonHover()
 {
     BtnHoverEvent.Post(gameObject);
 }
 public void SetMainMenuState()
 {
     PlayerAliveState.SetValue();
     MenuState.SetValue();
     MessageEvent.Post(gameObject);
 }
 public void OnMessageCancel()
 {
     CancelMessageEvent.Post(gameObject);
 }
Example #28
0
 public void PlayDraft()
 {
     Draft.Post(gameObject);
 }
 public void OnButtonPress()
 {
     BtnClickEvent.Post(gameObject);
 }
Example #30
0
 // Start is called before the first frame update
 void Start()
 {
     MainTheme.Post(gameObject);
 }