public void OutPoker() { PokerManage pokerManage = GetComponent <PokerManage>(); TimeManage.SetTimer(30, delegate() { pokerManage.mIsNext = true; Sprite s = Resources.Load <Sprite>("img/next"); ShowWord.Say(wordPos, s, SayEnd); }); pokerManage.mIsNext = false; ArrayList pks = GreaterPoker(); AllPoker aps = allPoker.GetComponent <AllPoker>(); if (pks.Count != 0) { Debug.Log(gameObject.name + "out poker:" + (pks[0] as GameObject).GetComponent <PokerAttr>().size); CallBack.Set(useTime, delegate() { Judge.beforePoker = new Comb(pks); pokerManage.OutPoker(pks); pokerManage.RefreshPoker(); aps.outPokerEnd(gameObject); }); } else { pokerManage.mIsNext = true; Sprite s = Resources.Load <Sprite>("img/next"); ShowWord.Say(wordPos, s, SayEnd); } }
void ButtonBack(string name) { switch (name) { case ButtonManage.ButtonNames.BeLandlord: Judge.AddOdds(2); buttons.GetComponent <ButtonManage>().SetButtons(new string[] {}); TimeManage.SetTimer(30, outPokerTimeout); player1.GetComponent <PokerManage>().outPokerAble = true; chapter.transform.parent.transform.position = gameObject.transform.position + new Vector3(0, 200, 0); chapter.GetComponent <Animator>().Play("toPlayer1"); ArrayList ps = new ArrayList(); ps.Add(allPoker[Random.Range(0, allPoker.Count)]); allPoker.Remove(ps[0]); ps.Add(allPoker[Random.Range(0, allPoker.Count)]); allPoker.Remove(ps[1]); ps.Add(allPoker[0]); allPoker.RemoveAt(0); player1.GetComponent <PokerManage>().addPokers(ps); break; case ButtonManage.ButtonNames.DoNot: SceneManager.LoadScene("1"); break; default: break; } buttons.GetComponent <ButtonManage>().SetButtons(new string[] { }); }
void Start() { Manage = GameObject.FindGameObjectWithTag("LifeTimeManager").GetComponent <TimeManage> (); #if UNITY_EDITOR if (Manage == null) { Debug.Log("AccountantTime - LifeTimeManager not found"); } #endif }
void Update() { if (mTime > 0) { if (TimeManage.GetTimeStamp() >= startTime + mTime) { mTime = 0; mBack(); } } }
void addPokerBack() { addBackNum++; if (addBackNum == 3) { string[] s = new string[2]; s[0] = ButtonManage.ButtonNames.BeLandlord; s[1] = ButtonManage.ButtonNames.DoNot; buttons.GetComponent <ButtonManage>().SetButtons(s, ButtonBack); TimeManage.SetTimer(4, landlordTimeout); addBackNum = 0; } }
void Start() { Manage = GameObject.FindGameObjectWithTag("LifeTimeManager").GetComponent <TimeManage> (); #if UNITY_EDITOR if (Manage == null) { Debug.Log("AccountantTime - LifeTimeManager not found"); } #endif for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); } }
public void outPokerEnd(GameObject player) { if (isEnd) { return; } switch (player.name) { case "Player1": player1.GetComponent <PokerManage>().outPokerAble = false; player2.GetComponent <PokerManage>().outPokerAble = true; player2.GetComponent <AI>().OutPoker(); break; case "Player2": player2.GetComponent <PokerManage>().outPokerAble = false; player3.GetComponent <PokerManage>().outPokerAble = true; player3.GetComponent <AI>().OutPoker(); break; case "Player3": player3.GetComponent <PokerManage>().outPokerAble = false; player1.GetComponent <PokerManage>().outPokerAble = true; string[] buts = null; if (player1.GetComponent <PokerManage>().HaveUpPoker()) { buts = new string[] { ButtonManage.ButtonNames.OutPoker, ButtonManage.ButtonNames.Next }; } else { buts = new string[] { ButtonManage.ButtonNames.Next }; } buttons.GetComponent <ButtonManage>().SetButtons(buts, delegate(string result) { buttons.GetComponent <ButtonManage>().SetButtons(new string[] { }); player1.GetComponent <PokerManage>().mIsNext = true; Sprite s = Resources.Load <Sprite>("img/next"); ShowWord.Say(new Vector3(0, -50, 0), s, delegate() { outPokerEnd(player1); }); }); TimeManage.SetTimer(30, delegate() { player1.GetComponent <PokerManage>().mIsNext = true; Sprite s = Resources.Load <Sprite>("img/next"); ShowWord.Say(new Vector3(0, -50, 0), s, delegate() { outPokerEnd(player1); }); }); break; } }
public static void Set(int time, Action back) { mTime = time; mBack = back; startTime = TimeManage.GetTimeStamp(); }