Пример #1
0
    // Use this for initialization
    void Start()
    {
        scaletime          = 1.94f;
        playservicesscript = FindObjectOfType <PlayServicesScript> ();
        audiosource        = GetComponent <AudioSource>();
        rb              = GetComponent <Rigidbody2D> ();
        birdtalk        = FindObjectOfType <birdtalkscript> ();
        backchanger     = FindObjectOfType <backchanger> ();
        characterchange = FindObjectOfType <characterchange> ();
        backchanger.backgroundlist [PlayerPrefs.GetInt("backindex", 0)].SetActive(true);
        buildlevel();
        rewardbtn.gameObject.SetActive(false);
        highscore.text = "Highscore " + PlayerPrefs.GetInt("highscore").ToString();
        //	pause = false;

        //	button.onClick.AddListener (Application.Quit);
        Time.timeScale = 0;
        pausebutton.onClick.AddListener(pausefunc);

        mainmenu.SetActive(true);
        deathmenu.SetActive(false);
        Camera.main.orthographicSize = 12;

        birdscale = gameObject.transform.localScale;
        //admanager = FindObjectOfType<admanager_> ();


        highscorepopup.SetActive(false);
    }
    public static PlayServicesScript Instance; //{ get; private set; }

    void Awake()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);
    }