private int GetGroupId(EnumSoundType type) { Npc npc = m_Property.GetNPCTemplateVO(); NpcCombat nc = m_CfgEternityProxy.GetNpcCombatByKey(npc.Id); return(nc.DeadVideoPhone); }
public void PlayVideoSoundToNpc(EnumSoundType type, string key) { int groupId = GetGroupId(type); if (groupId == 0) { BehaviorManager.Instance.LogFormat(m_Agent, $"PlayVideoSoundToNpc type:{type} groupId{groupId}"); return; } PlayParameter playParameter = new PlayParameter(); playParameter.groupId = groupId; playParameter.action = () => { if (!string.IsNullOrEmpty(key) && m_Index.ContainsKey(key)) { m_Index[key]++; } }; GameFacade.Instance.SendNotification(NotificationName.VideoPhoneChange, playParameter); BehaviorManager.Instance.LogFormat(m_Agent, $"PlayVideoSoundToNpc type:{type} groupId{groupId}"); }
private int GetModelSoundId(EnumSoundType type) { Model model = m_CfgEternityProxy.GetItemModelByKey(m_Property.GetItemID()); uint soundId = 0; switch (type) { case EnumSoundType.DeathExplosion: soundId = model.DieSound; break; case EnumSoundType.DeadSlide: soundId = model.GlideSound; break; default: BehaviorManager.Instance.LogFormat(m_Agent, $"GetModelSoundId type:{type} not have this sound in model.csv"); break; } BehaviorManager.Instance.LogFormat(m_Agent, $"GetModelSoundId type:{type} soundId:{soundId}"); return((int)soundId); }
public void PlayModelSound(EnumSoundType type, string key) { int soundID = GetModelSoundId(type); if (soundID == 0) { BehaviorManager.Instance.LogFormat(m_Agent, $"PlayModelSound type:{type} soundID:{soundID} not have sound in model.csv"); return; } Sound? sound = m_CfgEternityProxy.GetSoundByKey((uint)soundID); SoundEvent soundEvent = m_CfgEternityProxy.GetSoundEvent((uint)sound.Value.EventId); WwiseUtil.PlaySound(soundID, false, soundEvent.Type ? m_Property.GetRootTransform() : null, (object obj) => { if (!string.IsNullOrEmpty(key) && m_Index.ContainsKey(key)) { m_Index[key]++; } }); BehaviorManager.Instance.LogFormat(m_Agent, $"PlayModelSound type:{type} soundID:{soundID} is3D:{soundEvent.Type}"); }