public bool IsGameObjectGroupVailed(int groupId, UnityEngine.GameObject target) { AKAudioEntry.AudioAssert(target != null); int instanceId = target.GetInstanceID(); return(typeSwitch_GameObjHash_Datas.ContainsKey(instanceId)); }
/// <summary> /// 枪械开火 /// </summary> /// <param name="weaponState"></param> public static void PerformOnGunFire(WeaponLogic.IPlayerWeaponState weaponState) { if (AudioInfluence.IsForbidden || AKAudioEntry.Dispatcher == null) { return; } NewWeaponConfigItem weaponCfg = SingletonManager.Get <WeaponConfigManager>().GetConfigById(weaponState.CurrentWeapon); AKAudioEntry.AudioAssert(weaponCfg != null, string.Format("weapon config id [{0}] not find", weaponState.CurrentWeapon)); //假装有event AKAudioEntry.Dispatcher.PostEvent(testWeaponEvent, weaponState.CurrentWeaponGo); }
public static void PerformOnGunSwitch(NewWeaponConfigItem weaponCfg) { if (AudioInfluence.IsForbidden || AKAudioEntry.Dispatcher == null) { return; } AKAudioEntry.AudioAssert(weaponCfg != null, string.Format("weapon config id [{0}] not find", weaponCfg.Id)); //假装有event int eventId = 2; testWeaponEvent = testWeaponEvent == 1 ? 2 : 1; AKAudioEntry.Dispatcher.PrepareEvent(testWeaponEvent); }
public AKRESULT VarySwitchState(int groupId, UnityEngine.GameObject target, string state = "") { AKAudioEntry.AudioAssert(target != null); int instanceId = target.GetInstanceID(); AKSwitchGroup group; AKRESULT ret; if (typeSwitch_GameObjHash_Datas.TryGetValue(instanceId, out group)) { if (string.IsNullOrEmpty(state)) { ret = AkSoundEngine.SetSwitch(group.GetGroupName(), group.GetDefaultState(), target); } else if (!group.CanVaryState(state)) { return(AKRESULT.AK_InvalidStateGroupElement); } else { ret = AkSoundEngine.SetSwitch(group.GetGroupName(), state, target); } } else { group = AKSwitchGroup.Allocate(groupId, target); if (group.CanVaryState(state)) { ret = AkSoundEngine.SetSwitch(group.GetGroupName(), state, target); } else { ret = AkSoundEngine.SetSwitch(group.GetGroupName(), group.GetDefaultState(), target); } typeSwitch_GameObjHash_Datas.Add(instanceId, group); } VaryGroupIfSucess(group, ret, state); return(ret); }