/// <summary> /// 创建卡牌游戏物体 /// </summary> /// <param name="card"></param> /// <param name="index"></param> private void createGo(CardDto card, int index, GameObject cardPrefab) { GameObject cardGo = Object.Instantiate(cardPrefab, cardParent) as GameObject; cardGo.name = card.Name; cardGo.transform.localPosition = new Vector2((0.25f * index), 0); MultiCardCtrl cardCtrl = cardGo.GetComponent <MultiCardCtrl>(); cardCtrl.Init(card, index, false); //存储本地 this.cardCtrlList.Add(cardCtrl); }
/// <summary> /// 创建卡牌游戏物体 /// </summary> /// <param name="card"></param> /// <param name="index"></param> private void createGo(CardDto card, int index, GameObject cardPrefab) { GameObject cardGo = Object.Instantiate(cardPrefab, cardParent) as GameObject; cardGo.name = card.Name; cardGo.transform.localPosition = new Vector2((0.25f * index), 0); MultiCardCtrl cardCtrl = cardGo.GetComponent <MultiCardCtrl>(); bool isDealerfirst; if (index == 0) { isDealerfirst = true; } else { isDealerfirst = false; } cardCtrl.Init(card, index, isDealerfirst); //存储本地 this.cardCtrlList.Add(cardCtrl); }