コード例 #1
0
 public ActiveSound(SoundStyle style, Vector2 position)
 {
     Position = position;
     Volume   = 1f;
     IsGlobal = false;
     Style    = style;
     Play();
 }
コード例 #2
0
ファイル: ActiveSound.cs プロジェクト: xiongyaya/Terraria
 public ActiveSound(SoundStyle style)
 {
     this.Position = Vector2.get_Zero();
     this.Volume   = 1f;
     this.IsGlobal = true;
     this._style   = style;
     this.Play();
 }
コード例 #3
0
 public SlotId Play(SoundStyle style, Vector2 position)
 {
     if (Main.dedServ || style == null || !style.IsTrackable)
     {
         return((SlotId)SlotId.Invalid);
     }
     return((double)Vector2.DistanceSquared(Main.screenPosition + new Vector2((float)(Main.screenWidth / 2), (float)(Main.screenHeight / 2)), position) > 100000000.0 ? (SlotId)SlotId.Invalid : this._trackedSounds.Add(new ActiveSound(style, position)));
 }
コード例 #4
0
ファイル: ActiveSound.cs プロジェクト: xiongyaya/Terraria
 public ActiveSound(SoundStyle style, Vector2 position)
 {
     this.Position = position;
     this.Volume   = 1f;
     this.IsGlobal = false;
     this._style   = style;
     this.Play();
 }
コード例 #5
0
 public ActiveSound(SoundStyle style)
 {
     Position = Vector2.Zero;
     Volume   = 1f;
     IsGlobal = true;
     Style    = style;
     Play();
 }
コード例 #6
0
 public static ActiveSound FindActiveSound(SoundStyle style)
 {
     if (!IsAudioSupported)
     {
         return(null);
     }
     return(_player.FindActiveSound(style));
 }
コード例 #7
0
 public static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
 {
     //IL_0007: Unknown result type (might be due to invalid IL or missing references)
     //IL_0014: Unknown result type (might be due to invalid IL or missing references)
     if (!IsAudioSupported)
     {
         return(SlotId.Invalid);
     }
     return(_player.Play(style, position));
 }
コード例 #8
0
        public SlotId Play(SoundStyle style)
        {
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0026: Unknown result type (might be due to invalid IL or missing references)
            if (Main.dedServ || style == null || !style.IsTrackable)
            {
                return(SlotId.Invalid);
            }
            ActiveSound activeSound = new ActiveSound(style);

            return(_trackedSounds.Add(activeSound));
        }
コード例 #9
0
 public ActiveSound FindActiveSound(SoundStyle style)
 {
     //IL_000f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0014: Unknown result type (might be due to invalid IL or missing references)
     //IL_0015: Unknown result type (might be due to invalid IL or missing references)
     //IL_0023: Unknown result type (might be due to invalid IL or missing references)
     foreach (SlotVector <ActiveSound> .ItemPair item in (SlotVector <ActiveSound>)_trackedSounds)
     {
         if (item.Value.Style == style)
         {
             return(item.Value);
         }
     }
     return(null);
 }
コード例 #10
0
 public ActiveSound FindActiveSound(SoundStyle style)
 {
     using (IEnumerator <SlotVector <ActiveSound> .ItemPair> enumerator = ((IEnumerable <SlotVector <ActiveSound> .ItemPair>) this._trackedSounds).GetEnumerator())
     {
         while (((IEnumerator)enumerator).MoveNext())
         {
             SlotVector <ActiveSound> .ItemPair current = enumerator.Current;
             if (((ActiveSound)current.Value).Style == style)
             {
                 return((ActiveSound)current.Value);
             }
         }
     }
     return((ActiveSound)null);
 }
コード例 #11
0
        public SlotId Play(SoundStyle style, Vector2 position)
        {
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0059: Unknown result type (might be due to invalid IL or missing references)
            if (Main.dedServ || style == null || !style.IsTrackable)
            {
                return(SlotId.Invalid);
            }
            if (Vector2.DistanceSquared(Main.screenPosition + new Vector2(Main.screenWidth / 2, Main.screenHeight / 2), position) > 1E+08f)
            {
                return(SlotId.Invalid);
            }
            ActiveSound activeSound = new ActiveSound(style, position);

            return(_trackedSounds.Add(activeSound));
        }
コード例 #12
0
 public static SlotId PlayTrackedSound(SoundStyle style)
 {
     return((SlotId)SlotId.Invalid);
 }
コード例 #13
0
ファイル: SoundEngine.cs プロジェクト: egshels/Sources
 public static SlotId PlayTrackedSound(SoundStyle style)
 {
     //IL_0000: Unknown result type (might be due to invalid IL or missing references)
     return(SlotId.Invalid);
 }
コード例 #14
0
ファイル: SoundEngine.cs プロジェクト: egshels/Sources
 public static ActiveSound FindActiveSound(SoundStyle style)
 {
     return(null);
 }
コード例 #15
0
 public static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
 {
     return((SlotId)SlotId.Invalid);
 }
コード例 #16
0
 public SlotId Play(SoundStyle style)
 {
     return(Main.dedServ || style == null || !style.IsTrackable ? (SlotId)SlotId.Invalid : this._trackedSounds.Add(new ActiveSound(style)));
 }
コード例 #17
0
 public static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
 {
     return(!SoundEngine.IsAudioSupported ? (SlotId)SlotId.Invalid : SoundEngine._player.Play(style, position));
 }
コード例 #18
0
 public static ActiveSound FindActiveSound(SoundStyle style)
 {
     return(!SoundEngine.IsAudioSupported ? (ActiveSound)null : SoundEngine._player.FindActiveSound(style));
 }