Beispiel #1
0
    public void GameOver()
    {
        Bonus.DestroyBonus();

        IsContinue = false;
        RotateCircleController.live.rotatespeed = 0f;

        RotateCircleController.live.GetComponent <SpriteRenderer>().sprite = null;



        for (int i = 0; i < sprites.Count; i++)
        {
            sprites[i].SetActive(true);
            Vector3 explosionright = -sprites[i].transform.right + sprites[i].transform.up;
            Vector3 explosionleft  = sprites[i].transform.right - sprites[i].transform.up;

            int explosıonamount = Random.Range(350, 600);
            if (Random.Range(2, 8) < 5)
            {
                sprites[i].GetComponent <Rigidbody2D>().AddForce(explosionright * explosıonamount);
            }
            else
            {
                sprites[i].GetComponent <Rigidbody2D>().AddForce(explosionleft * explosıonamount);
            }
        }
        RotateCircleController.live.knifes.ForEach(x => x.KinfesForce());
        //KnifeController.DestroyAllKnife();
        StartCoroutine(SceneLoadTimer());
        Debug.Log("oyun bitti");
    }