Exemplo n.º 1
0
    public void ClonePetList(API_Game.PetList pet)
    {
        id        = pet.gender;
        namePet   = pet.name;
        gender    = pet.gender;
        hunger    = pet.hunger;
        happiness = pet.happiness;
        // emotion = pet.emotion;
        UUID           = pet.uuid.ToString();
        selected       = pet.selected;
        status         = pet.status;
        lastTimeReward = pet.lastTimeReward.ToString();

        color   = pet.color;
        head    = pet.head;
        ear     = pet.ear;
        eye     = pet.eye;
        eyebrow = pet.eyebrow;
        nose    = pet.nose;
        mouth   = pet.mouth;
        pattern = pet.pattern;

        shirtWearing       = pet.shirt;
        pantWearing        = pet.pant;
        shoeWearing        = pet.shoe;
        accessoriesWearing = pet.accessories;
    }
Exemplo n.º 2
0
    private static Player Loaded()
    {
        Player m_Save = new Player();

        m_Save.coin             = API_Game.Ins.player.player.coin;
        m_Save.lastTimeInGame   = string.Format("{0:yyyy-MM-dd}", API_Game.Ins.player.player.lastLogin);
        m_Save.lastTimeLotteyry = string.Format("{0:yyyy-MM-dd}", API_Game.Ins.player.player.lastLottery);
        m_Save.pets             = new List <Pet>();
        for (int i = 0; i < API_Game.Ins.player.player.petList.Count; i++)
        {
            API_Game.PetList p = API_Game.Ins.player.player.petList[i];
            Pet pet            = new Pet();

            pet.id             = p.gender;
            pet.namePet        = p.name;
            pet.gender         = p.gender;
            pet.hunger         = p.hunger;
            pet.happiness      = p.happiness;
            pet.UUID           = p.uuid.ToString();
            pet.selected       = p.selected;
            pet.status         = p.status;
            pet.lastTimeReward = p.lastTimeReward.ToString();

            pet.color   = p.color;
            pet.head    = p.head;
            pet.ear     = p.ear;
            pet.eye     = p.eye;
            pet.eyebrow = p.eyebrow;
            pet.nose    = p.nose;
            pet.mouth   = p.mouth;
            pet.pattern = p.pattern;

            pet.accessoriesWearing = p.accessories;
            pet.shirtWearing       = p.shirt;
            pet.pantWearing        = p.pant;
            pet.shoeWearing        = p.shoe;

            m_Save.pets.Add(pet);
        }
        m_Save.inventory         = new Inventory();
        m_Save.inventory.clothes = new List <Clothes>();
        for (int i = 0; i < API_Game.Ins.player.player.inventorycloth.Count; i++)
        {
            API_Game.Inventorycloth c = API_Game.Ins.player.player.inventorycloth[i];
            Clothes clothes           = new Clothes();

            clothes.id    = c.clothid;
            clothes.type  = c.type;
            clothes.count = c.count;

            m_Save.inventory.clothes.Add(clothes);
        }
        m_Save.inventory.furniture = new List <Furniture>();
        for (int i = 0; i < API_Game.Ins.player.player.inventoryfurniture.Count; i++)
        {
            API_Game.Inventoryfurniture c = API_Game.Ins.player.player.inventoryfurniture[i];
            Furniture furniture           = new Furniture();

            furniture.id               = c.furnitureid;
            furniture.realId           = c.id;
            furniture.type             = c.type;
            furniture.furnitureIsUsing = c.@using;
            furniture.position         = new Vector3(c.vx, c.vy, c.vz);
            furniture.rotation         = new Quaternion(c.qx, c.qy, c.qz, c.qw);

            m_Save.inventory.furniture.Add(furniture);
        }
        m_Save.inventory.foods = new List <Food>();
        for (int i = 0; i < API_Game.Ins.player.player.inventoryfood.Count; i++)
        {
            API_Game.Inventoryfood c = API_Game.Ins.player.player.inventoryfood[i];
            Food food = new Food();

            food.id    = c.foodid;
            food.count = c.count;

            m_Save.inventory.foods.Add(food);
        }
        SaveSystem.Ins.p = m_Save;
        return(m_Save);
    }