Inheritance: MonoBehaviour
    void Start()
    {
        _button = GetComponent <UnityAdsButton>();

        _initialPos  = transform.localPosition;
        _disabledPos = new Vector3(_initialPos.x, _initialPos.y, disabledPosZ);

        transform.localPosition = _disabledPos;
    }
Esempio n. 2
0
    //int isSkin2Sold;
    //public GameObject skin2;
    //int isSkin3Sold;
    //public GameObject skin3;

    //SpawnScript spawn;
    //InputManager im;

    //int score = 0;

    // Start is called before the first frame update
    void Start()
    {
        /*if (Input.touchCount >= 1)
         * {
         *  coinsAmount = PlayerPrefs.GetInt("CoinsAmount");
         *  SceneManager.LoadScene("Game");
         *  Time.timeScale = 1.0f;
         *
         * }*/
        isPaused = false;

        au  = FindObjectOfType <Audio>();
        ui  = FindObjectOfType <UI>();
        pcc = FindObjectOfType <PlayerCustomisationControl>();
        uab = FindObjectOfType <UnityAdsButton>();

        coinsAmount = PlayerPrefs.GetInt("CoinsAmount");
        highscore   = PlayerPrefs.GetInt("Highscore");

        //PlayerPrefs.SetInt("isSkin2Sold", 0);
        //PlayerPrefs.SetInt("isSkin3Sold", 0);

        /*pcc.isSkin2Sold = PlayerPrefs.GetInt("isSkin2Sold");
        *  pcc.isSkin3Sold = PlayerPrefs.GetInt("isSkin3Sold");
        *  pcc.isSkin4Sold = PlayerPrefs.GetInt("isSkin4Sold");
        *  pcc.isSkin5Sold = PlayerPrefs.GetInt("isSkin5Sold");
        *  pcc.isSkin6Sold = PlayerPrefs.GetInt("isSkin6Sold");*/

        pcc.isSkin2Equipped = PlayerPrefs.GetInt("isSkin1Equipped");
        pcc.isSkin2Equipped = PlayerPrefs.GetInt("isSkin2Equipped");
        pcc.isSkin3Equipped = PlayerPrefs.GetInt("isSkin3Equipped");
        pcc.isSkin4Equipped = PlayerPrefs.GetInt("isSkin4Equipped");
        pcc.isSkin5Equipped = PlayerPrefs.GetInt("isSkin5Equipped");
        pcc.isSkin6Equipped = PlayerPrefs.GetInt("isSkin6Equipped");

        pcc.isTrail2Equipped = PlayerPrefs.GetInt("isTrail1Equipped");
        pcc.isTrail2Equipped = PlayerPrefs.GetInt("isTrail2Equipped");
        pcc.isTrail3Equipped = PlayerPrefs.GetInt("isTrail3Equipped");
        pcc.isTrail4Equipped = PlayerPrefs.GetInt("isTrail4Equipped");
        pcc.isTrail5Equipped = PlayerPrefs.GetInt("isTrail5Equipped");
        pcc.isTrail6Equipped = PlayerPrefs.GetInt("isTrail6Equipped");

        //spawn = FindObjectOfType<SpawnScript>();
        //im = FindObjectOfType<InputManager>();
    }
Esempio n. 3
0
    IEnumerator CheckVideoStatus()
    {
        if (Advertisement.isShowing)          // Close WaitForUnityAds if the video is alredy being shown.

        {
            gameObject.SetActive(false);
        }
        else            // Otherwise check if the video is ready and show

        {
            if (string.IsNullOrEmpty(UnityAdsButton.zoneId))
            {
                UnityAdsButton.zoneId = null;
            }
            float time = Time.time;

            while (!Advertisement.IsReady(UnityAdsButton.zoneId))
            {
                if (!Advertisement.isInitialized)
                {
                    Advertisement.Initialize(Advertisement.gameId);
                    yield return(new WaitForSeconds(limetTimeOut - 2f));
                }

                //Debug.Log (Advertisement.IsReady (UnityAdsButton.zoneId));

                if (Time.time > time + limetTimeOut)
                {
                    StopCoroutine("AnimText");
                    UnityAdsButton.ShowAdPlacement();                      // call video "A menssage of video failed will be shown"
                    break;
                }

                yield return(null);
            }

            UnityAdsButton.ShowAdPlacement();              // Call the video
            gameObject.SetActive(false);
        }
    }