public override void Awake()
 {
     base.Awake();
     this.EnabledWhenPaused = false;
     this.Serialize         = false;
     this.lastRotation      = this.idleRotation = this.Rotation;
     SoundKiller.Add(this.Entity, AK.EVENTS.STOP_PLAYER_BREATHING_SOFT);
 }
Exemplo n.º 2
0
        public static void Add(Entity entity, params uint[] events)
        {
            SoundKiller killer = entity.GetOrCreate <SoundKiller>();

            foreach (uint e in events)
            {
                killer.Events.Add(e);
            }
        }
Exemplo n.º 3
0
        public override void Awake()
        {
            base.Awake();
            this.EnabledWhenPaused = false;
            this.Character         = new Character(this.main, this, Vector3.Zero);
            this.Add(new NotifyBinding(this.main.EarlyUpdateablesModified, this.UpdateOrder));
            this.Character.Body.Tag = this;
            this.main.Space.Add(this.Character);

            AkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_FALL, this.Entity);
            AkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_PLAYER_FALL, 0.0f);
            SoundKiller.Add(this.Entity, AK.EVENTS.STOP_PLAYER_FALL);

            this.Add(new ChangeBinding <float>(this.Health, delegate(float old, float value)
            {
                if (value < old && this.damageTimer > damageSoundInterval)
                {
                    AkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_HURT, this.Entity);
                    this.damageTimer = 0.0f;
                    this.Rumble.Execute(Math.Min(0.3f, (old - value) * 2.0f));
                }
                if (old > 0.0f && value <= 0.0f)
                {
                    this.Die.Execute();
                }
            }));

            this.Add(new Binding <float>(this.main.TimeMultiplier, () => this.SlowMotion && !this.main.Paused ? 0.4f : 1.0f, this.SlowMotion, this.main.Paused));
            this.Add(new ChangeBinding <bool>(this.SlowMotion, delegate(bool old, bool value)
            {
                if (!old && value)
                {
                    this.slowmoTimer = 0;
                }
            }));
        }
Exemplo n.º 4
0
 public static void Add(Entity entity, params string[] events)
 {
     SoundKiller.Add(entity, events.Select(x => AkSoundEngine.GetIDFromString(x)).ToArray());
 }