Beispiel #1
0
    void GetAccountComplete(RecordAccount account)
    {
        List <RecordPet> pets = account != null ? account.pets : null;

        if (loading != null)
        {
            loading.SetActive(false);
        }

        if (pets != null)
        {
            for (int i = 0; i < pets.Count; i++)
            {
                MyPet myPet = Instantiate(myPetProto) as MyPet;
                myPet.gameObject.SetActive(true);
                myPet.Set(pets [i]);
                myPet.transform.SetParent(myPetProto.transform.parent);
                myPet.name = pets [i].id;

                if (myPets == null)
                {
                    myPets = new List <MyPet> ();
                }

                myPets.Add(myPet);

                Debug.Log("create " + myPet.name);
            }
        }

        money.text = "money: " + (account != null ? account.money.ToString() : "---");
    }
Beispiel #2
0
    public void Show(RecordPet pet)
    {
        this.pet = pet;
        myPet.Set(pet);
        buttonAttack.SetActive(false);
        buttonDone.SetActive(false);

        textWin.SetActive(false);
        textLost.SetActive(false);

        UpdateMoney(null);
        Server.GetAccount(UpdateMoney);
        Server.GetEnemy(pet, GetEnemyComplete);

        SetButtonsAttack(attackType);
        SetButtonsProtect(protectType);
    }
Beispiel #3
0
 void GetEnemyComplete(RecordPet petEnemy)
 {
     this.petEnemy = petEnemy;
     enemyPet.Set(petEnemy);
     buttonAttack.SetActive(true);
 }