Example #1
0
    public void SaveLevel(int star)
    {
        var obj = JsonConvert.DeserializeObject <Levemapmanager>(ObscuredPrefs.GetString("DataMap"));

        // string levelString = ObscuredPrefs.GetString("level");
        //int level = int.Parse(levelString.Substring(5));
        int levelMax = ObscuredPrefs.GetInt("levelmax");
        int level    = ObscuredPrefs.GetInt("level");

        if (level > levelMax)
        {
            ObscuredPrefs.SetInt("levelmax", level);
            Debug.Log("levelmax=" + level);
        }
        obj.LevelMaps[level - 1].KeyLock = -1;
        obj.LevelMaps[level].KeyLock     = 1;
        obj.LevelMaps[level - 1].Star    = star;
        var a = JsonConvert.SerializeObject(obj);

        ObscuredPrefs.SetString("DataMap", a);
        if (level % 10 == 0)
        {
            LayerShare.SetActive(true);
        }
        if (!string.IsNullOrEmpty(GetDataFacebook.IDFacebook))
        {
            ObscuredPrefs.SetString("score", gm.score.ToString());

            AzureUILeaderboard azure = FindObjectOfType <AzureUILeaderboard>();
            if (azure != null)
            {
                azure.QueryIdFacebook(GetDataFacebook.IDFacebook, "Level" + level);
            }
        }
    }
Example #2
0
	 void Start () {
	//	rigidbody2d.rigidbody.freezeRotation;
		leaderBoard = GetComponent<AzureUILeaderboard>();
	
		rigidbody2d.velocity=new Vector3 (0,-3 -Time.timeSinceLevelLoad*0.01f ,0);
		ballColor = GetComponent<SpriteRenderer>().color;
		levleManager = FindObjectOfType<LevelManager>();
		middlePitch=(PlayerPrefsManager.GetHighestPitch()+PlayerPrefsManager.GetLowhestPitch())/2;
	}
Example #3
0
    void Start()
    {
        //	rigidbody2d.rigidbody.freezeRotation;
        leaderBoard = GetComponent <AzureUILeaderboard>();

        rigidbody2d.velocity = new Vector3(0, -3 - Time.timeSinceLevelLoad * 0.01f, 0);
        ballColor            = GetComponent <SpriteRenderer>().color;
        levleManager         = FindObjectOfType <LevelManager>();
        middlePitch          = (PlayerPrefsManager.GetHighestPitch() + PlayerPrefsManager.GetLowhestPitch()) / 2;
    }
Example #4
0
 private void AuthCallback1(ILoginResult result)
 {
     gameObject.SetActive(false);
     if (Application.loadedLevelName == "GameMap")
     {
         GameObject getDatafacebook = GameObject.FindGameObjectWithTag("facebookcontroll");
         getDatafacebook.GetComponent <GetDataFacebook>().GetAvatar();
         LayerFriendFacebook.SetActive(true);
         AzureUILeaderboard azure = FindObjectOfType <AzureUILeaderboard>();
         azure.QueryListLevel(gameObject.name);
         LayerSpinFacebook.SetActive(false);
     }
 }
Example #5
0
    void btnClick()
    {
        iTween.PunchScale(gameObject, new Vector3(0.2f, 0.2f), 0.3f);
        ControllerButtonMap controllerButtonMap = FindObjectOfType <ControllerButtonMap>();
        ReadDataMap         readData            = FindObjectOfType <ReadDataMap>();

        readData.ReadMission(gameObject.name);
        controllerButtonMap.btnChooseLevel();
        int level = int.Parse(gameObject.name.Substring(5));

        ObscuredPrefs.SetInt("level", level);
        if (!string.IsNullOrEmpty(GetDataFacebook.IDFacebook))
        {
            GetDataFacebook getdatafacebook = FindObjectOfType <GetDataFacebook>();
            getdatafacebook.ClearData();
            AzureUILeaderboard azure = FindObjectOfType <AzureUILeaderboard>();
            azure.QueryListLevel(gameObject.name);
        }

        // admodads.bannerView.Show();
    }