// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { hand = GameObject.Find("Hand"); hands = hand.GetComponent <HandsOnline>(); Display(); //grave = hands.GetGrave(); } }
public void NextDrawnPlayer() //常にNextTurnPlayer()が先に呼び出されるようにする必要がある { int nextD = 0; hand = GameObject.Find("Hand"); hands = hand.GetComponent <HandsOnline>(); switch (CountWinners()) { case 0: nextD = (turnPlayer + 3) % 4; break; case 1: if (hands.hands[(turnPlayer + 3) % 4].Count == 0) { nextD = (turnPlayer + 2) % 4; } else { nextD = (turnPlayer + 3) % 4; } break; case 2: if (hands.hands[(turnPlayer + 3) % 4].Count == 0) { if (hands.hands[(turnPlayer + 2) % 4].Count == 0) { nextD = (turnPlayer + 1) % 4; } else { nextD = (turnPlayer + 2) % 4; } } else { nextD = (turnPlayer + 3) % 4; } break; default: for (int pl = 0; pl < 4; pl++) { if (hands.hands[pl].Count != 0) { nextD = pl; } } break; } preDrawnPlayer = drawnPlayer; drawnPlayer = nextD; }
public void updateField() { initSources(); hands = GetComponent <HandsOnline>(); distribute(); Center(); foreach (GameObject source in sources) { source.name = "Card" + source.GetComponent <CardModel>().cardIndex; } }
//void OnGUI() //{ // if (GUI.Button(new Rect(120, 10, 100, 20), "distribute")) // { // initSources(); // hands = GetComponent<Hands>(); // distribute(); // Center(); // foreach (GameObject source in sources) // { // source.name = "Card" + source.GetComponent<CardModel>().cardIndex; // } // } //} public void StartGame() { initSources(); hands = GetComponent <HandsOnline>(); distribute(); Center(); foreach (GameObject source in sources) { source.name = "Card" + source.GetComponent <CardModel>().cardIndex; } zizikaku = GameObject.Find("GameManager").GetComponent <ZiziKakuOnline>(); }
void get() { gameManager = GameObject.Find("GameManager"); draw = gameManager.GetComponent <DrawOnline>(); turnManager = gameManager.GetComponent <TurnManagerOnline>(); turnPlayer = turnManager.turnPlayer; drawnPlayer = turnManager.drawnPlayer; preDrawnPlayer = turnManager.preDrawnPlayer; drawnCard = turnManager.drawnCard; hand = GameObject.Find("Hand"); //Handのクラスを取得 hands = hand.GetComponent <HandsOnline>(); cardModel = GetComponent <CardModel>(); cardIndex = cardModel.cardIndex; //カードモデルからcardIndexを取得 }
private void get() { //card = GameObject.Find("Card"); turnManager = GetComponent <TurnManagerOnline>(); record = GetComponent <RecordOnline>(); turn = turnManager.turn; tP = turnManager.turnPlayer; dP = turnManager.drawnPlayer; hand = GameObject.Find("Hand"); //Handのクラスを取得 hands = hand.GetComponent <HandsOnline>(); for (int i = 0; i < numOfComs; i++) { coms[numOfPlayer + i] = GameObject.Find("Com" + (numOfPlayer + i)).GetComponent <ComputerOnline>(); //Debug.Log("Com" + (i + 1)); } }
private void get() { //card = GameObject.Find("Card"); turnManager = GetComponent <TurnManagerOnline>(); record = GetComponent <RecordOnline>(); turn = turnManager.turn; tP = turnManager.turnPlayer; dP = turnManager.drawnPlayer; hand = GameObject.Find("Hand"); //Handのクラスを取得 hands = hand.GetComponent <HandsOnline>(); md = GameObject.Find("ModeData").GetComponent <ModeData>(); zizikaku = GetComponent <ZiziKakuOnline>(); for (int i = 0; i < 4; i++) { coms[i] = GameObject.Find("Com" + (i)).GetComponent <ComputerVer2Online>(); //Debug.Log("Com" + (i + 1)); } }
public void updateField() { initSources(); hands = GetComponent <HandsOnline>(); distribute(); Center(); foreach (GameObject source in sources) { CardModel cm = source.GetComponent <CardModel>(); int index = cm.cardIndex; source.name = "Card" + index; if (zizikaku.InGuessList(index)) { cm.ToggleZizikaku(); cm.ToggleFace(true); } } }
public void NextTurnPlayer() { hand = GameObject.Find("Hand"); hands = hand.GetComponent <HandsOnline>(); int nextT = 0; switch (CountWinners()) { case 0: nextT = (turnPlayer + 1) % 4; break; case 1: if (hands.hands[turnPlayer].Count == 0 || hands.hands[(turnPlayer + 1) % 4].Count == 0) { nextT = (turnPlayer + 2) % 4; } else { nextT = (turnPlayer + 1) % 4; } break; case 2: if (hands.hands[turnPlayer].Count == 0) { if (hands.hands[(turnPlayer + 2) % 4].Count == 0 || hands.hands[(turnPlayer + 1) % 4].Count == 0) { nextT = (turnPlayer + 3) % 4; } else { nextT = (turnPlayer + 2) % 4; } } else { if (hands.hands[(turnPlayer + 1) % 4].Count == 0 && hands.hands[(turnPlayer + 2) % 4].Count == 0) { nextT = (turnPlayer + 3) % 4; } if (hands.hands[(turnPlayer + 1) % 4].Count == 0 && hands.hands[(turnPlayer + 3) % 4].Count == 0) { nextT = (turnPlayer + 2) % 4; } if (hands.hands[(turnPlayer + 2) % 4].Count == 0 && hands.hands[(turnPlayer + 3) % 4].Count == 0) { nextT = (turnPlayer + 1) % 4; } } break; default: for (int pl = 0; pl < 4; pl++) { if (hands.hands[pl].Count != 0) { nextT = pl; } } break; } turnPlayer = nextT; }
private void get() { Hand = GameObject.Find("Hand"); hands = Hand.GetComponent <HandsOnline>(); }
public void updateSource() { hand = GameObject.Find("Hand"); hands = hand.GetComponent <HandsOnline>(); Display(); }