Beispiel #1
0
    public void Card3()
    {
        gameObject.SetActive(false);

        int[] whiteMass1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        int   k          = 0;

        for (int i = 1; i < 20; i++)
        {
            if (Masses.GetBoardColor(i) == 0)
            {
                whiteMass1[k] = i;
                k++;
            }
        }

        int[] whiteMass2 = new int[k];
        for (int i = 0; i < k; i++)
        {
            whiteMass2[i] = whiteMass1[i];
        }

        int[] whiteMass3 = whiteMass2.OrderBy(i => Guid.NewGuid()).ToArray();
        if (whiteMass2.Length == 1)
        {
            Masses.ChangeMass(whiteMass3[0], "4,5000,5000G");
            Masses.ChangeColor(4, whiteMass3[0]);
        }
        else if (whiteMass2.Length == 0)
        {
            Card3Error.SetTrue();
            card[3]++;
        }
        else
        {
            Masses.ChangeMass(whiteMass3[0], "4,5000,5000G");
            Masses.ChangeColor(4, whiteMass3[0]);
            Masses.ChangeMass(whiteMass3[1], "4,5000,5000G");
            Masses.ChangeColor(4, whiteMass3[1]);
        }

        card[3] -= 1;

        if (card[3] == 0)
        {
            Use3.SetFalse();
        }
    }
Beispiel #2
0
    public void Move(int moveCount)
    {
        //プレイヤがいたところを-10
        Masses.ChangeMass(nextPlace - 1, "0");
        AnimationController.SetTrue();

        var sequence = DOTween.Sequence();

        if (DoubleMoveFlag)
        {
            moveCount     *= 2;
            DoubleMoveFlag = false;

            if (CardMenu.GetCard(1) > 0)
            {
                Use1.SetTrue();
            }
        }

        for (int i = 0; i < moveCount; i++)
        {
            int   j = 0;
            float k = 0;
            if (nextPlace == 20)
            {
                nextPlace = 0;
            }
            positionX = Masses.MassGameObjects[nextPlace].transform.localPosition.x;
            positionZ = Masses.MassGameObjects[nextPlace].transform.localPosition.z;

            float time = 0.2f;

            sequence.Append(
                this.gameObject.transform.DOMoveX(positionX, time)
                );
            sequence.Append(
                this.transform.DOMoveZ(positionZ, time)
                );

            if (nextPlace == 0)
            {
                sequence.Append(
                    this.gameObject.transform.DORotate(new Vector3(0, 270, 0), 1f)
                    );
            }
            else if (nextPlace == 5)
            {
                sequence.Append(
                    this.gameObject.transform.DORotate(new Vector3(0, 180, 0), 1f)
                    );
            }
            else if (nextPlace == 10)
            {
                sequence.Append(
                    this.gameObject.transform.DORotate(new Vector3(0, 90, 0), 1f)
                    );
            }
            else if (nextPlace == 15)
            {
                sequence.Append(
                    this.gameObject.transform.DORotate(new Vector3(0, 0, 0), 1f)
                    );
            }

            if (nextPlace == 0)
            {
                if (DoubleGoldFlag)
                {
                    sequence.AppendCallback(() => gold += 20000);
                    StartBonusText.Double();
                    DoubleGoldFlag = false;

                    if (CardMenu.GetCard(2) > 0)
                    {
                        Use2.SetTrue();
                    }
                }
                else
                {
                    sequence.AppendCallback(() => gold += 10000);
                    StartBonusText.Normal();
                }
                sequence.AppendCallback(() => StartBonus.Bonus());
            }

            nextPlace += 1;

            if (i == moveCount - 1)
            {
                sequence.AppendCallback(() => RouletteController.RotMoveFinish());
                sequence.AppendCallback(() => MassEffect(nextPlace - 1));
                sequence.AppendCallback(() => AnimationController.SetFalse());
            }
        }
    }