public MySpriteSheet(MySpriteSheet copiedSheet) { leftSprite = copiedSheet.leftSprite; rightSprite = copiedSheet.rightSprite; frontSprite = copiedSheet.frontSprite; backSprite = copiedSheet.backSprite; }
public static void UpdateSkinForBodyPart(CharacterSkinObject skinObject, MySpriteSheet newSkin) { BodyPart bodyPart = newSkin.BodyPart; switch (bodyPart) { case BodyPart.Head: skinObject.head = newSkin; break; case BodyPart.Chest: skinObject.chest = newSkin; break; case BodyPart.LeftArm: skinObject.leftArm = newSkin; break; case BodyPart.RightArm: skinObject.rightArm = newSkin; break; case BodyPart.LeftLeg: skinObject.leftLeg = newSkin; break; case BodyPart.RightLeg: skinObject.rightLeg = newSkin; break; default: Debug.Log("Wrong BodyPart"); break; } }
void ClearSpriteSheets() { headSpriteSheet = null; chestSpriteSheet = null; leftArmSpriteSheet = null; rightArmSpriteSheet = null; leftLegSpriteSheet = null; rightLegSpriteSheet = null; }
void EquipItem(int id) { if (InventoryObject.CheckId(id, inventory)) { MySpriteSheet newSkin = inventory.ownedGear[id].gear.Skin; CharacterSkinObject.ChangeSkin(skin, newSkin); inventory.ownedGear[id].isEquipped = true; } }
public static void ChangeSkin(CharacterSkinObject skinObject, MySpriteSheet newSkin) { //BodyPart match = newSkin.BodyPart; //skinObject.bodySpriteSheets[match] = newSkin; //UpdateSkinObjectSheets(skinObject); UpdateSkinForBodyPart(skinObject, newSkin); Debug.Log("Skin changed! " + newSkin); }
public void UpdateSheets() { headSpriteSheet = currentSkin.head; chestSpriteSheet = currentSkin.chest; leftArmSpriteSheet = currentSkin.leftArm; rightArmSpriteSheet = currentSkin.rightArm; leftLegSpriteSheet = currentSkin.leftLeg; rightLegSpriteSheet = currentSkin.rightLeg; UpdateSheetDictionaries(); }
void UnequipItem(int id) { if (InventoryObject.CheckId(id, inventory)) { MySpriteSheet newSkin = inventory.ownedGear[id].gear.Skin; MySpriteSheet defaultPart = defaultSkin.GetBodySheet(newSkin.BodyPart); CharacterSkinObject.ChangeSkin(skin, defaultPart); inventory.ownedGear[id].isEquipped = false; } }
public void changeSpriteSheet(PlayerSpriteSheet.Type type, AnimationKey animationKey) { this.currentType = type; this.MySpriteSheet = getSpriteSheetByType(type); this.MyTexture = MySpriteSheet.getTexture(animationKey, 0); }