Exemplo n.º 1
0
    public bool AddCard(CardInZhibo cardInfo)
    {
        IResLoader loader = GameMain.GetInstance().GetModule <ResLoader>();

        GameObject cardGo = loader.Instantiate("Zhibo/Card");

        if (cardGo == null)
        {
            return(false);
        }
        MiniCard card = cardGo.GetComponent <MiniCard>();

        card.Init(cardInfo, this);
        card.transform.SetParent(transform, false);
        cards.Add(card);
        Adjust();
        return(true);
    }
Exemplo n.º 2
0
    public bool AddTmpCard(CardInZhibo cardInfo)
    {
        IResLoader loader = GameMain.GetInstance().GetModule <ResLoader>();

        GameObject cardGo = loader.Instantiate("Zhibo/Card", FixedContainer);

        if (cardGo == null)
        {
            return(false);
        }
        MiniCard card = cardGo.GetComponent <MiniCard>();

        card.Init(cardInfo, this);
        card.rt.anchoredPosition = Vector3.zero;
        card.rt.localEulerAngles = Vector3.zero;
        TmpCards.Add(card);
        AdjustTmp();
        return(true);
    }