private PuyoPair GenerateNewPuyoPair() { var rand1 = Convert.ToInt32(UnityEngine.Random.Range(0, 4)); var go1 = Instantiate(puyoPrefabs[rand1], new Vector3(10f, 10f), Quaternion.identity) as GameObject; var puyoColor = PuyoHelper.GetPuyoColorFromString(go1.tag); go1.GetComponent <Puyo>().Initialize(puyoColor); var rand2 = Convert.ToInt32(UnityEngine.Random.Range(0, 4)); var go2 = Instantiate(puyoPrefabs[rand2], new Vector3(10f, 10f), Quaternion.identity) as GameObject; var puyoColor2 = PuyoHelper.GetPuyoColorFromString(go2.tag); go2.GetComponent <Puyo>().Initialize(puyoColor2); return(new PuyoPair(go1, go2)); }
private void InitRandomArray() { for (int i = 0; i < 5; i++) { for (int j = 0; j < GameVariable.Columns; j++) { var rand = Convert.ToInt32(UnityEngine.Random.Range(0, 4)); var position = FindPuyoScreenPosition(i, j); var go = Instantiate(puyoPrefabs[rand], position, Quaternion.identity) as GameObject; var puyoColor = PuyoHelper.GetPuyoColorFromString(go.tag); go.GetComponent <Puyo>().Initialize(puyoColor, i, j); puyos[i, j] = go; } } }
public void ThrowOutOfRangeExceptionWhenPassingPink() { PuyoHelper.GetPuyoColorFromString("pink"); }
public void ReturnGreenWhenPassingGreen() { Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Green"), PuyoColor.Green); }
public void ReturnYellowWhenPassingYellow() { Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Yellow"), PuyoColor.Yellow); }
public void ReturnRedWhenPassingRed() { Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Red"), PuyoColor.Red); }
public void ReturnBlueWhenPassingBlue() { Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Blue"), PuyoColor.Blue); }
public void ThrowArgumentNullExceptionWhenPassingEmptyColor() { PuyoHelper.GetPuyoColorFromString(string.Empty); }