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