public override void OnGameStart() { if (Profile.Get.CurrentGame.Character.Gender == CharacterGender.Male) { PlayerVoiceType = MasterAudio.SoundType.PlayerVoiceMale; } else { PlayerVoiceType = MasterAudio.SoundType.PlayerVoiceFemale; } Player.Get.AvatarActions.Subscribe(AvatarAction.Move, new ActionListener(Move)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveJump, new ActionListener(MoveJump)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveLandOnGround, new ActionListener(MoveLandOnGround)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveWalk, new ActionListener(MoveWalk)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveSprint, new ActionListener(MoveSprint)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveEnterWater, new ActionListener(MoveEnterWater)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveExitWater, new ActionListener(MoveExitWater)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveCrouch, new ActionListener(MoveCrouch)); Player.Get.AvatarActions.Subscribe(AvatarAction.MoveStand, new ActionListener(MoveStand)); Player.Get.AvatarActions.Subscribe(AvatarAction.ItemAddToInventory, new ActionListener(ItemAddToInventory)); Player.Get.AvatarActions.Subscribe(AvatarAction.BarterMakeTrade, new ActionListener(BarterMakeTrade)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalDie, new ActionListener(SurvivalDie)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalTakeDamage, new ActionListener(SurvivalTakeDamage)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalTakeDamageCritical, new ActionListener(SurvivalTakeDamageCritical)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalTakeDamageOverkill, new ActionListener(SurvivalTakeDamageOverkill)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalDangerEnter, new ActionListener(SurvivalDangerEnter)); Player.Get.AvatarActions.Subscribe(AvatarAction.SurvivalDangerExit, new ActionListener(SurvivalDangerExit)); Player.Get.AvatarActions.Subscribe(AvatarAction.MissionActivate, new ActionListener(MissionActivate)); Player.Get.AvatarActions.Subscribe(AvatarAction.MissionComplete, new ActionListener(MissionComplete)); Player.Get.AvatarActions.Subscribe(AvatarAction.MissionObjectiveActiveate, new ActionListener(MissionObjectiveActivate)); Player.Get.AvatarActions.Subscribe(AvatarAction.MissionObjectiveComplete, new ActionListener(MissionObjectiveComplete)); Player.Get.AvatarActions.Subscribe(AvatarAction.PathMarkerReveal, new ActionListener(PathMarkerReveal)); Player.Get.AvatarActions.Subscribe(AvatarAction.PathStartFollow, new ActionListener(PathStartFollow)); Player.Get.AvatarActions.Subscribe(AvatarAction.PathStopFollow, new ActionListener(PathStopFollow)); Player.Get.AvatarActions.Subscribe(AvatarAction.SkillLearn, new ActionListener(SkillLearn)); Player.Get.AvatarActions.Subscribe(AvatarAction.ToolUse, new ActionListener(ToolUse)); Player.Get.AvatarActions.Subscribe(AvatarAction.BookAquire, new ActionListener(BookReadOrAquire)); Player.Get.AvatarActions.Subscribe(AvatarAction.BookRead, new ActionListener(BookReadOrAquire)); Player.Get.AvatarActions.Subscribe(AvatarAction.SkillCredentialsGain, new ActionListener(SkillCredentialsGain)); Player.Get.AvatarActions.Subscribe(AvatarAction.ItemPlaceFail, new ActionListener(ItemPlaceFail)); Player.Get.AvatarActions.Subscribe(AvatarAction.ItemAddToInventory, new ActionListener(ItemAddToInventory)); player.Inventory.State.PlayerBank.OnMoneyAdded += OnBankChange; enabled = true; }
public static void MakeWorldSound(IItemOfInterest source, MasterAudio.SoundType soundType, string soundName) { IAudible audibleSource = (IAudible)source.gameObject.GetComponent(typeof(IAudible)); if (audibleSource != null) { MakeWorldSound(audibleSource, soundType, soundName); } }
protected override void OnStartUsing() { SoundType = ParentObject.LastSoundType; SoundName = ParentObject.LastSoundName; Collider.radius = ParentObject.AudibleRange + Globals.MaxAudibleRange; //this will ensure that any creature can potentially hear it Collider.height = Collider.radius; //we don't want a capsule shape Collider.center = Vector3.zero; }
public static void MakeWorldSound(IAudible source, MasterAudio.SoundType soundType, string soundName) { //use master audio to create a sound //attach an audible bubble to the source AudibleBubble audibleBubble = null; AudioSource sourceAudio = null; if (MasterAudio.PlaySound(soundType, source.transform, source.AudibleVolume, ref sourceAudio, soundName)) { source.LastSoundType = soundType; source.LastSoundName = soundName; audibleBubble = sourceAudio.gameObject.GetOrAdd <AudibleBubble> (); audibleBubble.StartUsing(source, null, 0.25f); } }
public void HearSound(IAudible source, MasterAudio.SoundType type, string sound) { //Debug.Log ("Potentially heard sound in " + name + ", it's a " + source.IOIType.ToString ()); //first see if it's in audible range if (source.IsAudible && IsInAudibleRange(worlditem.tr.position, source.Position, AwarenessDistanceTypeToAudibleDistance(State.AudioAwarnessDistance), source.AudibleRange)) { //if it's in range AND we're able to hear it //Debug.Log ("Yup definitely heard it"); if (IsAudible(worlditem.tr.position, source.Position, AwarenessDistanceTypeToAudibleSensitivity(State.AudioSensitivity), source.AudibleVolume)) { LastHeardPlayer = null; LastHeardItemOfInterest = null; switch (source.IOIType) { case ItemOfInterestType.Player: LastHeardPlayer = source.player; HeardPlayerGizmo = 1f; break; case ItemOfInterestType.WorldItem: LastHeardWorldItem = source.worlditem; break; default: break; } LastHeardItemOfInterest = source; if (LastHeardPlayer != null) { OnHearPlayer.SafeInvoke(); } if (LastHeardWorldItem != null) { OnHearWorldItem.SafeInvoke(); } OnHearItemOfInterest.SafeInvoke(); } else { source.ListenerFailToHear(); } } }
public static void MakeWorldSound(IAudible Source, List <Collider> ignoreColliders, MasterAudio.SoundType SoundType) { //use master audio to create a sound //attach an audible bubble to the source AudibleBubble audibleBubble = null; AudioSource sourceAudio = null; if (MasterAudio.PlaySound(SoundType, Source.transform, Source.AudibleVolume, ref sourceAudio)) { Source.LastSoundType = SoundType; audibleBubble = sourceAudio.gameObject.GetOrAdd <AudibleBubble> (); audibleBubble.StartUsing(Source, ignoreColliders, 0.25f); } }