Esempio n. 1
0
    /// <summary>
    /// 召唤选中的角色卡
    /// </summary>
    public void SummonCharacterUp(CharacterCard card, GameManager.GameSide side)
    {
        LogsSystem.Instance.Print(string.Format("{0}召唤{1}上场", side.ToString(), card.GetCardName()));

        //召唤卡片到场上
        string path = string.Format("UI Root/Background/GamePanel/{0}side/CardGrid", side.ToString());
        GameObject parent = GameObject.Find(path);
        GameObject prefab = Resources.Load<GameObject>("CharacterCard");
        GameObject go = NGUITools.AddChild(parent, prefab);
        CardContainer container = go.GetComponent<CardContainer>();
        container.SetCardData(card, true);
        parent.GetComponent<UIGrid>().Reposition();
    }