public CustomSpriterAnimator( SpriterEntity entity, IProviderFactory <ISprite, SoundEffect> providerFactory = null, Stack <SpriteDrawInfo> drawInfoPool = null ) : base(entity, providerFactory, drawInfoPool) { _providerFactory = providerFactory; _drawInfoPool = drawInfoPool; _hiddenTextures = new List <string>(); _textureSwapMap = new Dictionary <string, Texture2D>(); _pointTexture = new TextureSprite(TextureUtil.CreateCircle(XmasHell.Instance().GraphicsDevice, 1, Color.Cyan)); if (entity.ObjectInfos != null) { foreach (SpriterObjectInfo objInfo in entity.ObjectInfos) { if (objInfo.ObjectType != SpriterObjectType.Box) { continue; } _boxTextures[objInfo.Name] = new TextureSprite(TextureUtil.CreateRectangle(XmasHell.Instance().GraphicsDevice, (int)objInfo.Width, (int)objInfo.Height, Color.Cyan)); } } }
public static void PlayRandomSound(List <SoundEffect> sounds) { sounds[XmasHell.Instance().GameManager.Random.Next(0, sounds.Count - 1)].Play(); }
public void ZIndex(int value, Layer?layer = null) { _ZIndex = value; XmasHell.Instance().SpriteBatchManager.SortSpriterAnimator(layer); }