private void SetPlayerImg() { if (gameData.player.avatarSprite == null) { var spriteAssetData = new SpriteAssetData("Player", playerSpriteIndex); gameData.player.spriteAssetData = spriteAssetData; gameData.player.avatarSprite = playerImg.sprite; } playerImg.sprite = gameData.player.avatarSprite; }
public void NextImg() { var playerSpriteList = gameData.assetData.PlayerList; playerSpriteIndex++; if (playerSpriteIndex >= playerSpriteList.Count) { playerSpriteIndex = 0; } var spriteAssetData = new SpriteAssetData("Player", playerSpriteIndex); playerImg.sprite = gameData.assetData.getSprite(spriteAssetData); gameData.player.spriteAssetData = spriteAssetData; gameData.player.avatarSprite = gameData.assetData.getSprite(spriteAssetData); }
public Player(AssetData assetData, SavePlayerData sp) { this.Name = sp.Name; this.TotalHP = sp.TotalHP; this.HP = sp.HP; this.Level = sp.Level; this.XP = sp.XP; this.spriteAssetData = sp.spriteAssetData; this.avatarSprite = assetData.getSprite(sp.spriteAssetData); this.itemList = sp.itemList; this.usableItemList = sp.usableItemList; this.weapon = sp.weapon; this.armor = sp.armor; }
public Player(AssetData assetData) { this.Name = "Player"; this.TotalHP = 100; this.HP = this.TotalHP; this.Level = 1; this.XP = 0; this.spriteAssetData = new SpriteAssetData("Player", 0); this.avatarSprite = assetData.getSprite(this.spriteAssetData); itemList = new List <Item> (); itemList.Add(ItemFactory.getHealingPotion(assetData)); itemList.Add(ItemFactory.getRegenPotion(assetData)); itemList.Add(ItemFactory.getGrenade(assetData)); itemList.Add(ItemFactory.getPoison(assetData)); }
public static CustomPackInfo CreateCustomPack( SerializedAssets.Transaction assets, string id, string name, string coverImagePath ) { CustomPackInfo res = new CustomPackInfo(); var texture = Texture2DAssetData.CoverFromImageFile(coverImagePath, id, true); var texturePtr = assets.AppendAsset(texture); var sprite = SpriteAssetData.CreateCoverSprite(assets, texturePtr, id); var spPtr = assets.AppendAsset(sprite); res.collection = assets.AppendAsset(new MonoBehaviorAssetData() { data = new LevelCollectionBehaviorData(), name = id + "Collection", script = assets.scriptIDToScriptPtr[LevelCollectionBehaviorData.ScriptID] }); res.pack = assets.AppendAsset(new MonoBehaviorAssetData() { data = new LevelPackBehaviorData() { packName = name, packID = id + "Pack", isPackAlwaysOwned = true, beatmapLevelCollection = res.collection, coverImage = spPtr, }, name = id + "Pack", script = assets.scriptIDToScriptPtr[LevelPackBehaviorData.ScriptID] }); return(res); }
public Sprite getSprite(SpriteAssetData assetData) { List <Sprite> spriteList; switch (assetData.sheetName) { case "Player": spriteList = PlayerList; break; case "Demon": spriteList = DemonList; break; case "Elemental": spriteList = ElementalList; break; case "Humanoid": spriteList = HumanoidList; break; case "Reptile": spriteList = ReptileList; break; case "Undead": spriteList = UndeadList; break; case "Misc": spriteList = MiscList; break; case "Pest": spriteList = PestList; break; case "Quad": spriteList = QuadList; break; case "Armor": spriteList = ArmorList; break; case "Chest": spriteList = ChestList; break; case "LongWep": spriteList = LongWepList; break; case "MedWep": spriteList = MedWepList; break; case "ShortWep": spriteList = ShortWepList; break; case "Potion": spriteList = PotionList; break; default: spriteList = DemonList; break; } if (assetData.index < spriteList.Count) { return(spriteList [assetData.index]); } return(null); }