Esempio n. 1
0
		public override void OnEnter()
		{
			if (GenderAsString.Value.Equals("male",StringComparison.InvariantCultureIgnoreCase) )
			{
				Gender = GA_User.Gender.Male;
			}else if (GenderAsString.Value.Equals("female",StringComparison.InvariantCultureIgnoreCase) )
			{
				Gender = GA_User.Gender.Female;
			}

			GA.API.User.NewUser(
				Gender,
				BirthYear.IsNone		? null : (int?)BirthYear.Value,
				FriendCount.IsNone		? null : (int?)FriendCount.Value,
				iosId.IsNone			? null : iosId.Value,
				androidId.IsNone		? null : androidId.Value, 
				platform.IsNone			? null : platform.Value, 
				device.IsNone			? null : device.Value,  
				os.IsNone				? null : os.Value,  
				osVersion.IsNone		? null : osVersion.Value,  
				sdk.IsNone				? null : sdk.Value,  
				installPublisher.IsNone	? null : installPublisher.Value,  
				installSite.IsNone		? null : installSite.Value,  
				installCampaign.IsNone	? null : installCampaign.Value,  
				installAdGroup.IsNone	? null : installAdGroup.Value,  
				installAd.IsNone		? null : installAd.Value,  
				installKeyword.IsNone	? null : installKeyword.Value,
				facebookId.IsNone		? null : facebookId.Value,
				android_adID.IsNone		? null : android_adID.Value
				);

		
			Finish();
		}
Esempio n. 2
0
		public override void Reset()
		{
			Gender				= GA_User.Gender.Unknown;
			BirthYear 			= new FsmInt()    { UseVariable = true};
			FriendCount 		= new FsmInt()    { UseVariable = true};
			iosId 				= new FsmString() { UseVariable = true};
			androidId			= new FsmString() { UseVariable = true};
			platform			= new FsmString() { UseVariable = true};
			device				= new FsmString() { UseVariable = true};
			os					= new FsmString() { UseVariable = true};
			osVersion			= new FsmString() { UseVariable = true};
			sdk					= new FsmString() { UseVariable = true};
			installPublisher	= new FsmString() { UseVariable = true};
			installSite			= new FsmString() { UseVariable = true};
			installCampaign		= new FsmString() { UseVariable = true};
			installAdGroup		= new FsmString() { UseVariable = true};
			installAd			= new FsmString() { UseVariable = true};
			installKeyword		= new FsmString() { UseVariable = true};
			facebookId			= new FsmString() { UseVariable = true};
			android_adID		= new FsmString() { UseVariable = true};
		}
Esempio n. 3
0
		public override void Reset()
		{
			Gender = GA_User.Gender.Unknown;
			BirthYear = new FsmInt() { UseVariable = true };
			FriendCount = new FsmInt() { UseVariable = true };
		}
Esempio n. 4
0
    private void HighScoreWindow(int windowID)
    {
        GUILayout.BeginHorizontal();
        if (SCORE > HIGHSCORE)
        {
            GUILayout.Label("OLD HIGHSCORE:");
        }
        else
        {
            GUILayout.Label("HIGHSCORE:");
        }
        GUILayout.Label(HIGHSCORE.ToString());
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.BeginHorizontal();
        GUILayout.Label("NEW SCORE:");
        GUILayout.Label(SCORE.ToString());
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("BIRTH YEAR:");
        int birthyearParsed = 0;

        if (int.TryParse(GUILayout.TextField(_birthYear != 0?_birthYear.ToString():"", GUILayout.Width(50)), out birthyearParsed))
        {
            _birthYear = birthyearParsed;
        }
        else
        {
            _birthYear = 0;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("FRIEND COUNT:");
        int friendsParsed = 0;

        if (int.TryParse(GUILayout.TextField(_friendCount != 0?_friendCount.ToString():"", GUILayout.Width(50)), out friendsParsed))
        {
            _friendCount = friendsParsed;
        }
        else
        {
            _friendCount = 0;
        }
        GUILayout.EndHorizontal();

        GUILayout.Label("GENDER:");
        _genderIndex = genderComboBoxControl.List(new Rect(115, 130, 75, 20), genderComboBoxList[_genderIndex], genderComboBoxList, GUI.skin.button);

        GUILayout.Space(10);

        GUI.enabled = SCORE > HIGHSCORE;
        if (GUILayout.Button("SAVE", GUILayout.Width(100)))
        {
            HIGHSCORE = SCORE;
            PlayerPrefs.SetInt("GAExampleScore", SCORE);
            PlayerPrefs.Save();

            GA_User.Gender gender = GA_User.Gender.Unknown;
            if (_genderIndex == 1)
            {
                gender = GA_User.Gender.Female;
            }
            else if (_genderIndex == 2)
            {
                gender = GA_User.Gender.Male;
            }

            GA.API.User.NewUser(gender, _birthYear, _friendCount);
            GA_Queue.ForceSubmit();
        }
        GUI.enabled = true;
        if (GUILayout.Button("RESTART", GUILayout.Width(100)))
        {
            GAMEOVER = false;
            SCORE    = 0;

            GameObject ball = Instantiate(BallPrefab, new Vector3(0, 3, 0), Quaternion.identity) as GameObject;
            ball.name = "Ball";

            transform.position = _startingPosition;
            rigidbody.velocity = Vector3.zero;
        }

        if (!genderComboBoxControl.IsShowingList())
        {
            GUI.DrawTexture(new Rect(126, 156, 55, 55), GA.SettingsGA.Logo);
        }

        GUI.FocusWindow(0);
    }