private void CreateItemsForSingleTexture(Data.SmashBlockItemData itemData, Vector2 WorldPosition, Vector2 CameraPosition) { if (_registerObject != null) { for (int i = 0; i < itemData.Count; i++) { SmashBlockItem newItem = null; foreach (string s in Glowing_Item_Texture_Prefixes.Split(',')) { if (itemData.TextureName.StartsWith(s)) { newItem = new SmashBlockGlowingItem(); break; } } if (newItem == null) { newItem = new SmashBlockItem(); } newItem.TimerTickCallback = _registerTimerTick; newItem.Texture = TextureManager.Textures[itemData.TextureName]; newItem.Frame = TextureManager.Textures[itemData.TextureName].Bounds; newItem.WorldPosition = WorldPosition; newItem.CameraPosition = CameraPosition; _registerObject(newItem); } } }
private void CreateItemsForSingleTexture(Data.SmashBlockItemData itemData, Vector2 WorldPosition, Vector2 CameraPosition) { if (_registerObject != null) { for (int i = 0; i < itemData.Count; i++) { SmashBlockItem newItem = null; foreach (string s in Glowing_Item_Texture_Prefixes.Split(',')) { if (itemData.TextureName.StartsWith(s)) { newItem = new SmashBlockGlowingItem(); break; } } if (newItem == null) { newItem = new SmashBlockItem();} newItem.TimerTickCallback = _registerTimerTick; newItem.Texture = TextureManager.Textures[itemData.TextureName]; newItem.Frame = TextureManager.Textures[itemData.TextureName].Bounds; newItem.WorldPosition = WorldPosition; newItem.CameraPosition = CameraPosition; _registerObject(newItem); } } }