Beispiel #1
0
    public void Zipladiginda()
    {
        ballZipZipTriggerObject.transform.parent.GetComponent <Animator>().SetTrigger("parentup");

        if (ballZipZipTriggerObject.transform.GetComponent <CubesController>().ColorIndex == colorCt.rntBall)
        {
            colorCt.ColorBall();
            this.gameObject.transform.GetComponent <SpriteRenderer>().color = colorCt.CubesColor[colorCt.rntBall];
            ballZipZipTriggerObject.transform.GetChild(0).GetComponent <Animator>().SetTrigger("hitcoins");
            gameProperties.inGameCoins++;


            if (BallSpeed <= 1.95f)
            {
                BallSpeed += 0.025f;
            }

            RandomGameProperties.GameLevel++;
            randGamePro.Olustur();
            randGamePro.InsParentMove();
        }
        else
        {
            BallSpeed = 0.75f;
            StopBall  = true;

            if (sceneManager.gameProto.inGameCoins >= sceneManager.gameProto.MissionsCoins[sceneManager.gameProto.missionsId])
            {
                gameProperties.inGameCoins += 15;

                sceneManager.OyunBitti(gameProperties.inGameCoins, true);
            }
            else
            {
                sceneManager.OyunBitti(gameProperties.inGameCoins, false);
            }

            TouchArea.gameObject.SetActive(false);
        }
    }