Example #1
0
    private void OnClickRecycle(ButtonScript obj, object args, int param1, int param2)
    {
        if (GamePlayer.Instance.BattleBaby == null)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("NoBabyRecall"));
            return;
        }

        if (AttaclEvent.getInstance.BabyEvent != null)
        {
            AttaclEvent.getInstance.BabyEvent(GamePlayer.Instance.BattleBaby.InstId);
        }

        BattleActor babyInBattle = Battle.Instance.GetActorByInstId(GamePlayer.Instance.BattleBaby.InstId);

        if (babyInBattle.isDead == false)
        {
            Baby baby = new Baby();
            baby.Resize();
            baby.InstId = babyInBattle.InstId;
            baby.SetIprop(PropertyType.PT_TableId, babyInBattle.battlePlayer.tableId_);
            baby.SetIprop(PropertyType.PT_Level, babyInBattle.battlePlayer.level_);
            baby.SetIprop(PropertyType.PT_HpCurr, babyInBattle.battlePlayer.hpCrt_);
            baby.SetIprop(PropertyType.PT_MpCurr, babyInBattle.battlePlayer.mpCrt_);
            baby.SetIprop(PropertyType.PT_HpMax, babyInBattle.battlePlayer.hpMax_);
            baby.SetIprop(PropertyType.PT_MpMax, babyInBattle.battlePlayer.mpMax_);
            displayList_.Add(baby);
        }

        AttaclPanel.Instance.CloseBabyWindow();
    }