Пример #1
0
    //0.026,0.07,0.0045

    private void Start()
    {
        gameCanRestart = true;
        FindObjects();

        k = 0;
        alphaOptionsBeforeFade = 1.0f;
        alphaPlayBeforeFade    = 1.0f;
        x = 0;
        numberOfButtonPresses    = 0;
        menuGametypeFlapSpeed.x -= forwardSpeed;
        _GameOptions.SkyTypeContinuous();
        _GameOptions.FlapTypeToTheRight();
        timeFromStartOfTheGame = 0;
        firstFlap = false;

        gameIsInMenuMode = true;
        if (PlayerPrefs.GetInt("soundTypeEnabled") == 1)
        {
            canPlaySound = true;
        }
        else
        {
            canPlaySound = false;
        }

        audioTimesPlayed = 0;
        audioS           = GetComponent <AudioSource>();
        audioS.clip      = flapClip;

        if (Application.loadedLevel == 0)
        {
            rotation.Set(0, 0, 0, 0);
            pos   = this.transform.localPosition;
            pos.x = 0f;
            this.transform.localPosition = pos;
        }

        this.transform.localRotation = rotation;

        rb = GetComponent <Rigidbody2D>();
        InitialiseAnimator();
        velocity.x = forwardSpeed;
        frame      = 3f;
        showPaused();
        hideGameOver();
        gameStarted = false;
        dead        = false;
        //if(Application.loadedLevel==0){birdAtMenu=true;animator.SetTrigger("FlapAtMenu");gameStarted=false;}

        //hideAlmostPlayObject ();
        _FadeOutScriptTapTapImage.FadeOutObject(0.0f, 0.0f);

        if (PlayerPrefs.GetInt("gameType") == 2)
        {
            StartTheGameForcefully();
            //Debug.Log ("da");
            _GameOptions.GameTypeOne();
        }

        //QualitySettings.vSyncCount = 0;
        Application.targetFrameRate = 60;
    }