Esempio n. 1
0
    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));
    }
Esempio n. 2
0
    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;
            }
        }
    }
Esempio n. 3
0
 public void ThrowOutOfRangeExceptionWhenPassingPink()
 {
     PuyoHelper.GetPuyoColorFromString("pink");
 }
Esempio n. 4
0
 public void ReturnGreenWhenPassingGreen()
 {
     Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Green"), PuyoColor.Green);
 }
Esempio n. 5
0
 public void ReturnYellowWhenPassingYellow()
 {
     Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Yellow"), PuyoColor.Yellow);
 }
Esempio n. 6
0
 public void ReturnRedWhenPassingRed()
 {
     Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Red"), PuyoColor.Red);
 }
Esempio n. 7
0
 public void ReturnBlueWhenPassingBlue()
 {
     Assert.AreEqual(PuyoHelper.GetPuyoColorFromString("Blue"), PuyoColor.Blue);
 }
Esempio n. 8
0
 public void ThrowArgumentNullExceptionWhenPassingEmptyColor()
 {
     PuyoHelper.GetPuyoColorFromString(string.Empty);
 }