public sealed override void Play() { Transform grid = PlayerController.GetInstance().grids[5]; ArrayList cardList = new ArrayList(); for (int i = 0; i < grid.childCount; i++) { GameObject card = Instantiate(grid.GetChild(i).gameObject); EventDelegate.Callback callback = delegate { int index = 0; for (int ii = 0; ii < ShowCards.GetInstance().totalGrid.childCount; ii++) { if (string.Format("{0}(Clone)", ShowCards.GetInstance().totalGrid.GetChild(ii).name) == card.name) { index = ii; } } ShowCards.GetInstance().card = ShowCards.GetInstance().totalGrid.GetChild(index); ShowCards.GetInstance().card.SetTarget(PlayerController.GetInstance().grids[1]); base.Play(); }; EventDelegate.Add(card.GetComponent <UIButton>().onClick, callback); cardList.Add(card); } ShowCards.GetInstance().ShowLeader(cardList, grid, true, () => ShowCards.GetInstance().Hide()); }
public sealed override void Play() { System.Random random = new System.Random(); Transform grid = EnemyController.GetInstance().grids[1]; int max = grid.childCount; int random1 = random.Next(0, max); int random2 = random.Next(0, max); int random3 = random.Next(0, max); ArrayList cardList = new ArrayList(); cardList.Add(Instantiate(grid.GetChild(random1).gameObject)); cardList.Add(Instantiate(grid.GetChild(random2).gameObject)); cardList.Add(Instantiate(grid.GetChild(random3).gameObject)); ShowCards.GetInstance().ShowLeader(cardList, grid, false, () => base.Play()); }
public sealed override void Play() { Transform grid = PlayerController.GetInstance().grids[0]; ArrayList cardList = new ArrayList(); for (int i = 0; i < grid.childCount; i++) { if (grid.GetChild(i).GetComponent <CardProperty>().effect == Global.Effect.clear_sky || grid.GetChild(i).GetComponent <CardProperty>().effect == Global.Effect.frost || grid.GetChild(i).GetComponent <CardProperty>().effect == Global.Effect.fog || grid.GetChild(i).GetComponent <CardProperty>().effect == Global.Effect.rain) { GameObject card = Instantiate(grid.GetChild(i).gameObject); UIButton button = card.GetComponent <UIButton>(); EventDelegate.Add(button.onClick, () => card.GetComponent <CardBehavior>().Play()); EventDelegate.Add(button.onClick, () => isEnabled = false); cardList.Add(card); } } ShowCards.GetInstance().ShowLeader(cardList, grid, true, () => ShowCards.GetInstance().Hide()); }
public override void Play() { isEnabled = false; ShowCards.GetInstance().Hide(); PlayerController.GetInstance().PlayOver(transform); }
public sealed override void Play() { ShowCards.GetInstance().replaceInt = 0; Throw(); }