public void EventCallbackStartSinging() { string name = base.Actor.SimDescription.ChildOrBelow ? "vo_shower_singC" : "vo_shower_singA"; this.mSingInShowerSound = new ObjectSound(base.Actor.ObjectId, name); this.mSingInShowerSound.StartLoop(); }
public void StartWateringSound() { if (mWateringSound == null) { mWateringSound = (ObjectSound)(object)new ObjectSound(Target.ObjectId, "garden_water_lp"); ((Sound)mWateringSound).StartLoop(); } }
public new void Cleanup() { if (this.mSingInShowerSound != null) { this.mSingInShowerSound.Stop(); this.mSingInShowerSound.Dispose(); this.mSingInShowerSound = null; } }
public void StopWateringSound(StateMachineClient sender, IEvent evt) { if (mWateringSound != null) { ((Sound)mWateringSound).Stop(); ((Sound)mWateringSound).Dispose(); mWateringSound = null; } }
private void Start() { SplitPathAndName(); _soundHolder = new ObjectSound(gameObject, _path, _soundName); if (_typeStart == _type.Auto) { Play(); } }
public void Stop(TypeSFX _type, string _name) { if (GameData.isSound == 1) { ObjectSound _objectSound = listObject.Find(x => (x.type == _type)); Sound _sound = _objectSound.track.Find(y => (y.name == _name)); if (_sound != null) { _sound.source.Stop(); } } }
public void PlayRandom(TypeSFX _type) { if (GameData.isSound == 1) { ObjectSound obj = listObject.Find(x => (x.type == _type)); if (obj != null) { int randomIndex = Random.Range(0, obj.track.Count); obj.track[randomIndex].source.Play(); } } }
public void Play(TypeSFX _type, string _name) { if (GameData.isSound == 1) { //Debug.Log("PLAY SFX"); ObjectSound _objectSound = listObject.Find(x => (x.type == _type)); if (_objectSound != null) { Sound _sound = _objectSound.track.Find(y => (y.name == _name)); if (_sound != null && !_sound.source.isPlaying) { _sound.source.PlayOneShot(_sound.source.clip); } } } }
// Methods public override bool Run() { //The song from the shower string name = base.Actor.SimDescription.ChildOrBelow ? "vo_shower_singC" : "vo_shower_singA"; this.mSingInShowerSound = new ObjectSound(base.Actor.ObjectId, name); this.mSingInShowerSound.StartLoop(); //Animations from singing a solo song base.BeginCommodityUpdates(); base.EnterStateMachine("solo_generic", "Enter", "x"); base.SetParameter("AnimationName", "a2a_soc_neutral_singFriendly_friendly_neutral_x"); base.AnimateSim("Play Animation"); base.AnimateSim("Exit"); base.EndCommodityUpdates(true); this.mSingInShowerSound.Stop(); return(true); }
public void playSequential(TypeSFX _type) { ObjectSound _objectSound = listObject.Find(x => (x.type == _type)); int _index = PlayerPrefs.GetInt(_type.ToString(), 0); //Debug.LogError(_index); if (_objectSound != null) { if (_index >= _objectSound.track.Count) { PlayerPrefs.SetInt(_type.ToString(), _index = 0); } Sound _sound = _objectSound.track[_index]; if (_sound != null && !_sound.source.isPlaying) { _sound.source.PlayOneShot(_sound.source.clip); //Debug.LogError(_sound.name); PlayerPrefs.SetInt(_type.ToString(), ++_index); } } }
// Token: 0x06009AEB RID: 39659 RVA: 0x00350290 File Offset: 0x0034E490 public override bool Run() { try { /* * this.mSituation = (ServiceSituation.FindServiceSituationInvolving(this.Actor) as GrimReaperSituation); * //this.mSituation.AddRelationshipWithEverySimInHousehold(); * this.Actor.SetPosition(this.mSituation.Lot.Position); * this.mSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate)); * try * { * Sim sim = Target; * if (sim != null) * { * Matrix44 transform = sim.Transform; * Matrix44 invalid = Matrix44.Invalid; * Vector3 position = Actor.Position; * float num = (this.Actor.Position - sim.Position).LengthSqr(); * if (num < 0.25f || num > 4f) * { * double @double = RandomUtil.GetDouble(6.2831853071795862); * position = sim.Position + new Vector3((float)Math.Sin(@double), 0f, (float)Math.Cos(@double)); * } * this.Actor.SetForward(sim.PositionOnFloor - this.Actor.PositionOnFloor); * this.Actor.SetForward(new Vector3(this.Actor.ForwardVector.x, 0f, this.Actor.ForwardVector.z)); * SimDescription.DeathType deathStyle = sim.SimDescription.DeathStyle; * } * } * catch (Exception exception) * { * NiecException.PrintMessage("1a" + exception.Message + NiecException.NewLine + exception.StackTrace); * } * * this.Actor.GreetSimOnLot(this.mSituation.Worker.LotCurrent); * try * { * this.mSituation.SMCDeath = StateMachineClient.Acquire(this.Actor, "Death"); * this.mSituation.SMCDeath.SetActor("x", this.Actor); * this.mSituation.SMCDeath.EnterState("x", "Enter"); * this.mSituation.SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper)); * this.mSituation.StartGrimReaperSmoke(); * this.mSituation.SMCDeath.RequestState("x", "Float"); * this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null); * this.mWasMemberOfActiveHousehold = (this.Target.Household == Household.ActiveHousehold); * if (this.Target.DeathReactionBroadcast == null) * { * Urnstone.CreateDeathReactionBroadcaster(this.Target); * } * } * catch (Exception exception) * { * NiecException.PrintMessage("2" + exception.Message + NiecException.NewLine + exception.StackTrace); * } * try * { * this.Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted; * this.Target.SynchronizationLevel = Sim.SyncLevel.NotStarted; * this.mDeadSimsHousehold = this.Target.Household; * this.mSMCDeath = this.mSituation.SMCDeath; * ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.DoubleBalloonData("moodlet_mourning", this.Target.GetThoughtBalloonThumbnailKey()); * balloonData.BalloonType = ThoughtBalloonTypes.kSpeechBalloon; * balloonData.mPriority = ThoughtBalloonPriority.High; * this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData); * } * catch (Exception exception) * { * NiecException.PrintMessage("3" + exception.Message + NiecException.NewLine + exception.StackTrace); * } * try * { * var killSim = this.Target.CurrentInteraction as ExtKillSimNiec; * if (killSim != null) * { * killSim.StartDeathEffect(); * } * Audio.StartSound("sting_death", this.Actor.Position); * this.mSMCDeath.RequestState("x", "take_sim"); * this.mSMCDeath.RequestState("x", "Exit"); * this.Target.FadeOut(); * this.FinalizeDeath(); * this.GrimReaperPostSequenceCleanup(); * this.Target.StartOneShotFunction(new Sims3.Gameplay.Function(this.ReapSoulCallback), GameObject.OneShotFunctionDisposeFlag.OnDispose); * } * catch (Exception exception) * { * NiecException.PrintMessage("4" + exception.Message + NiecException.NewLine + exception.StackTrace); * } * return true; */ //var grimReaperSituation = ServiceSituation.FindServiceSituationInvolving as ; //grimReaperSituation.AddRelationshipWithEverySimInHousehold(); //grimReaperSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate)); this.Actor.SetPosition(Actor.Position); SimDescription.DeathType deathType = SimDescription.DeathType.Drown; try { Sim sim = FindClosestDeadSim(); if (sim != null) { Vector3 position = Vector3.Invalid; World.FindGoodLocationParams fglParams = new World.FindGoodLocationParams(sim.Position); Vector3 vector; if (!GlobalFunctions.FindGoodLocation(this.Actor, fglParams, out position, out vector)) { position = fglParams.StartPosition; } this.Actor.SetPosition(position); this.Actor.RouteTurnToFace(sim.Position); deathType = sim.SimDescription.DeathStyle; } } catch (Exception exception) { NiecException.PrintMessage("SAE" + exception.Message + NiecException.NewLine + exception.StackTrace); } //this.Actor.GreetSimOnLot(grimReaperSituation.Worker.LotCurrent); SMCDeath = StateMachineClient.Acquire(this.Actor, "DeathSequence"); SMCDeath.SetActor("x", this.Actor); SMCDeath.EnterState("x", "Enter"); Urnstone.FogEffectTurnAllOn(Actor.LotCurrent); VisualEffect visualEffect = Urnstone.ReaperApperEffect(this.Actor, deathType); visualEffect.Start(); //grimReaperSituation.StartGrimReaperSmoke(); VisualEffect.FireOneShotEffect("reaperSmokeConstant", Actor, Sim.FXJoints.Pelvis, VisualEffect.TransitionType.HardTransition); SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper)); SMCDeath.RequestState("x", "ReaperBrushingHimself"); visualEffect.Stop(); ReaperLoop = new ObjectSound(this.Actor.ObjectId, "death_reaper_lp"); ReaperLoop.Start(true); this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null); return(true); } catch (Exception exception) { NiecException.PrintMessage("ASF" + exception.Message + NiecException.NewLine + exception.StackTrace); return(true); } }