Exemplo n.º 1
0
        void Start()
        {
            CameraFade.StartAlphaFade(Color.black, true, 1f, 0f);
            //GOOGLE
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ()
            //			 enables saving game progress.
            //.EnableSavedGames()
            //				 registers a callback to handle game invitations received while the game is not running.
            //						.WithInvitationDelegate(<callback method>)
            //				 registers a callback for turn based match notifications received while the
            //				 game is not running.
            //						.WithMatchDelegate(<callback method>)
            .Build ();
            PlayGamesPlatform.InitializeInstance (config);
            // recommended for debugging:
            PlayGamesPlatform.DebugLogEnabled = true;
            // Activate the Google Play Games platform
            PlayGamesPlatform.Activate ();
            ((PlayGamesPlatform) Social.Active).SetDefaultLeaderboardForUI("CgkIneal8pETEAIQBg");

            ////SOOMLA
            //ProfileEvents.OnSoomlaProfileInitialized += onSoomlaProfileInitialized;
            StoreEvents.OnSoomlaStoreInitialized += OnSoomlaStoreInitialized;
            SoomlaStore.Initialize(new MyStoreAssets());
            //SoomlaProfile.Initialize();
        }
Exemplo n.º 2
0
    void Start()
    {
        mAuthCallback = (bool success) => {
            EndStandBy();
            if (success) {
                SwitchToMain();
            }
        };

        var config = new PlayGamesClientConfiguration.Builder()
            .WithInvitationDelegate(InvitationManager.Instance.OnInvitationReceived)
            .Build();

        PlayGamesPlatform.InitializeInstance(config);

        // make Play Games the default social implementation
        PlayGamesPlatform.Activate();

        // enable debug logs (note: we do this because this is a sample; on your production
        // app, you probably don't want this turned on by default, as it will fill the user's
        // logs with debug info).
        PlayGamesPlatform.DebugLogEnabled = true;

        // try silent authentication
        if (mAuthOnStart) {
            SetStandBy("Please wait...");
            PlayGamesPlatform.Instance.Authenticate(mAuthCallback, true);
        }
    }
Exemplo n.º 3
0
 void google_sign_in()
    {
        
           PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
        // enables saving game progress.
        //.EnableSavedGames()
        // registers a callback to handle game invitations received while the game is not running.
         //.WithInvitationDelegate(<this.Deb>)
        // registers a callback for turn based match notifications received while the
        // game is not running.
        //.WithMatchDelegate(<callback method>)
        // require access to a player's Google+ social graph to sign in
        .RequireGooglePlus()
        .Build();

    PlayGamesPlatform.InitializeInstance(config);
    // recommended for debugging:
    PlayGamesPlatform.DebugLogEnabled = true;
    // Activate the Google Play Games platform
    PlayGamesPlatform.Activate();
    
    //authenticate user:
    Social.localUser.Authenticate((bool success) =>
        {
            if(success)
            {
               // NGUIDebug.Log("success");
            }else
            {
              //  NGUIDebug.Log("fail to login");
            }
    //handle success or failure
    });
    }
Exemplo n.º 4
0
    void Awake()
    {
        Application.targetFrameRate = 60;

        Instance         = this;
        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();

        score         = 0;
        coin          = 0;
        modifierScore = 1;
        IsGameStart   = false;

        UpdateScore();
        UpdateModifier(0);
        UpdateCoin(false);
        UpdateDiamon(false);

        gameMenuAnim.SetTrigger("Hide");

        highScoreText.text = PlayerPrefs.GetInt("Highscore").ToString();

        // Ads
        Advertisement.Initialize(gameID, true);

#if UNITY_ANDROID
        // GPGS
        GooglePlayGames.BasicApi.PlayGamesClientConfiguration config = new GooglePlayGames.BasicApi.PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();
        PlayGamesPlatform.InitializeInstance(config);
        //PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        OnConnectionResponse(PlayGamesPlatform.Instance.localUser.authenticated);
#endif
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
     PlayGamesPlatform.InitializeInstance(config);
     PlayGamesPlatform.DebugLogEnabled = true;
     PlayGamesPlatform.Activate();
 }
    // Use this for initialization
    void Start()
    {
        mAuthCallback = (bool success) => {

            Debug.Log("In Auth callback, success = " + success);

            mSigningIn = false;
            if (success) {
                NavigationUtil.ShowMainMenu();
            } else {
                Debug.Log("Auth failed!!");
            }
        };

        // enable debug logs (note: we do this because this is a sample;
        // on your production app, you probably don't want this turned
        // on by default, as it will fill the user's logs with debug info).
        var config = new PlayGamesClientConfiguration.Builder()
            .WithInvitationDelegate(InvitationManager.Instance.OnInvitationReceived)
            .Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;

        // try silent authentication
        if (mAuthOnStart) {
            Authorize(true);
        }
    }
Exemplo n.º 7
0
    public void Initialize()
    {
        if (!isPlayingOffline)
        {
            // initialize google play to cloud save
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                .EnableSavedGames()
                .Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();

            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                {
                    MonoBehaviour.print("GooglePlayGames completed initialization");
                    OpenSavedgame(saveDataName);
                    isPlayingOffline = false;
                }
                else
                {
                    MonoBehaviour.print("GooglePlayGames failed to authenticate local user");
                    isPlayingOffline = true;
                }
            });
        }
    }
Exemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        GooglePlayGames.BasicApi.PlayGamesClientConfiguration config = new GooglePlayGames.BasicApi.PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();
        PlayGamesPlatform.DebugLogEnabled = true;
        if (ins == null)
        {
            ins = this;
        }
        else
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);
        //Create all my array
        StartingLevel = 10;
        TowerStats    = new int[Enum.GetNames(typeof(Stat)).Length];
        Currencies    = new int[Enum.GetNames(typeof(Currency)).Length];
        Loots         = new int[Enum.GetNames(typeof(Loot)).Length];
        Researchs     = new float[Enum.GetNames(typeof(Research)).Length];
        Abilities     = new float[Enum.GetNames(typeof(Ability)).Length];

        bootsMorale = GetComponent <BootsMoraleAbility> ();
        CreateTowerMesh();
        //LoadLocal ();
        hitpoint = StatsHelper.ins.GetStatsValue(Stat.HitPoint);
        AbilityManager.ins.Init();

        SceneManager.LoadScene("Menu");
    }
	void Awake () {
		UserCancelledInt = PlayerPrefs.GetInt("UserCancelledInt", 0);	
		PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
		
		PlayGamesPlatform.InitializeInstance(config);
		
		GooglePlayGames.PlayGamesPlatform.Activate();
	}
Exemplo n.º 10
0
	void Awake () {
	
		PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

		PlayGamesPlatform.InitializeInstance(config);

		GooglePlayGames.PlayGamesPlatform.Activate();

	}
Exemplo n.º 11
0
 public void ShowBoard()
 {
     PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ()
         .Build ();
     GooglePlayGames.PlayGamesPlatform.InitializeInstance (config);
     GooglePlayGames.PlayGamesPlatform.DebugLogEnabled = true;
     GooglePlayGames.PlayGamesPlatform.Activate ();
     PlayGamesPlatform.Instance.localUser.Authenticate((bool success) => {});
 }
Exemplo n.º 12
0
 void ConfigPlayGames()
 {
     var config = new PlayGamesClientConfiguration.Builder()
        .WithInvitationDelegate(InvitationManager.Instance.OnInvitationReceived)
        .Build();
     PlayGamesPlatform.InitializeInstance(config);
     //PlayGamesPlatform.DebugLogEnabled = true;
     Authorize(false);
 }
Exemplo n.º 13
0
    void Start()
    {
        // Select the Google Play Games platform as our social platform implementation
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
        GooglePlayGames.BasicApi.PlayGamesClientConfiguration config = new GooglePlayGames.BasicApi.PlayGamesClientConfiguration.Builder().Build();
        GooglePlayGames.PlayGamesPlatform.InitializeInstance(config);
        GooglePlayGames.PlayGamesPlatform.DebugLogEnabled = true;
        GooglePlayGames.PlayGamesPlatform.Activate();
#endif
    }
Exemplo n.º 14
0
	// Use this for initialization
	void Awake () {

		//stuffs I dont care bout
		PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
		
		PlayGamesPlatform.InitializeInstance(config);

		// Activate the Google Play Games platform shit
		GooglePlayGames.PlayGamesPlatform.Activate();	

			}
Exemplo n.º 15
0
    /*
     * Create the Play Games Client and configure it to enable saved game.
     * Authenticate the player's Google account.
     * */
    void Awake()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();

        PlayGamesPlatform.InitializeInstance(config);

        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate((bool success) =>
        {
        });
    }
Exemplo n.º 16
0
    void Awake()
    {
        PlayGamesPlatform.Activate();
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            .Build();

        PlayGamesPlatform.InitializeInstance(config);

        Social.localUser.Authenticate ((bool success) => {
            Debug.Log("Loguado correctamente");
        });
    }
Exemplo n.º 17
0
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
        .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        Social.localUser.Authenticate((bool success) =>
        {
            //Debug.Log(success);
        });
    }
Exemplo n.º 18
0
    void Start()
    {
		/*boat multiplier*/
		boatMultiplier = new int[6];
		boatMultiplier[0] = 1;
		boatMultiplier[1] = 2;
		boatMultiplier[2] = 3;
		boatMultiplier[3] = 4;
		boatMultiplier[4] = 5;
		boatMultiplier[5] = 6;

        
		/*set boats cost*/
        boatCost = new int[6];
        boatCost[0] = 1;
        boatCost[1] = 1;
        boatCost[2] = 1;
        boatCost[3] = 1;
        boatCost[4] = 1;
        boatCost[5] = 1;

		boatBought = new bool[6]; //checks if a boat is bought

		//Advertisement.Initialize("1023219", true);//initialize ad
       	
		PlayerPrefs.SetString("ReviveByAds","True");	//--- RC to check that revive button is pressed only once

		/*google play services setup*/
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        
		//PlayerPrefs.SetInt("slips", 10000);
        
		/*get slips value from registry*/
		slips = PlayerPrefs.GetInt("slips", 0);
		slipText.text = "Slips : " + slips.ToString ();
        
		/*sets up camera for ui*/
		move = true;
        moveTo = Camera.main.transform.position;

		message = blank;		// RC ----- to hide Internetcheck message

		achievement = Social.CreateAchievement();

		PlayerPrefs.SetString("BoatRevived", "false");
		slipsCollectedInOneGame =0;
		PlayerPrefs.SetInt("slipsCollectedInOneGame", slipsCollectedInOneGame);
    }
Exemplo n.º 19
0
 public void Show()
 {
     if (PlayGamesPlatform.Instance.localUser.authenticated) {
         PlayGamesPlatform.Instance.ShowLeaderboardUI ("CgkIjb_-z4oaEAIQBg");
     } else {
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ()
             .Build ();
         GooglePlayGames.PlayGamesPlatform.InitializeInstance (config);
         //GooglePlayGames.PlayGamesPlatform.DebugLogEnabled = true;
         GooglePlayGames.PlayGamesPlatform.Activate ();
         PlayGamesPlatform.Instance.localUser.Authenticate((bool success) => {
             PlayGamesPlatform.Instance.ShowLeaderboardUI ("CgkIjb_-z4oaEAIQBg");
         });
     }
 }
Exemplo n.º 20
0
    void Start()
    {
        if (! PlayGamesPlatform.Instance.localUser.authenticated)
        {
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();

            PlayGamesPlatform.InitializeInstance (config);
            // recommended for debugging:
            PlayGamesPlatform.DebugLogEnabled = true;
            // Activate the Google Play Games platform
            PlayGamesPlatform.Activate ();

            PlayGamesPlatform.Instance.Authenticate ((bool success) => { }, true);
        }
    }
Exemplo n.º 21
0
    // Use this for initialization
    void Start()
    {
        didPressButton = false;
        #if UNITY_ANDROID //&& !UNITY_EDITOR
        if (!isAuthenticated)
        {
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();

            Social.localUser.Authenticate(delegate(bool success) { Debug.Log("Authentication: " + success); isAuthenticated = true; });
        }
        #endif
    }
Exemplo n.º 22
0
    public void MultiplayerConfigAndInit()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            // registers a callback to handle game invitations received while the game is not running.
        .WithInvitationDelegate(InvitationReceived)
            // registers a callback for turn based match notifications received while the
            // game is not running.
        .Build();

        //PlayGamesPlatform.InitializeInstance(config);
        // recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = true;
        // Activate the Google Play Games platform
        PlayGamesPlatform.Activate();
    }
Exemplo n.º 23
0
    void Awake()
    {
        //Activamos Google Play para que permita guardado en la nube
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            // enables saving game progress.
            .EnableSavedGames()
                .Build();
        PlayGamesPlatform.InitializeInstance(config);
        DontDestroyOnLoad(gameObject);
        // recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = false;
        // Activate the Google Play Games platform
        PlayGamesPlatform.Activate();

        StartCoroutine("tryLogin");
    }
Exemplo n.º 24
0
    // Use this for initialization
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            // enables saving game progress.
            .EnableSavedGames()
            // registers a callback for turn based match notifications received while the
            // game is not running.
            .RequireGooglePlus()
            .Build();

        PlayGamesPlatform.InitializeInstance(config);
        // recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = true;
        // Activate the Google Play Games platform
        PlayGamesPlatform.Activate();
    }
	void Start ()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate((bool success) => {
            if (success)
            { 
				Application.LoadLevel("GamePlay"); 
			}
            else
            {
                Debug.Log("Failed");
            }
        } );
    }
Exemplo n.º 26
0
	public static void InitSave(){
		PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
			// enables saving game progress.
			.EnableSavedGames()
			// registers a callback to handle game invitations received while the game is not running.
			//	.WithInvitationDelegate(<callback method>)
			// registers a callback for turn based match notifications received while the
			// game is not running.
			//	.WithMatchDelegate(<callback method>)
			// require access to a player's Google+ social graph (usually not needed)
			//	.RequireGooglePlus()
			.Build();

		PlayGamesPlatform.InitializeInstance(config);
		// recommended for debugging:
		PlayGamesPlatform.DebugLogEnabled = true;
		// Activate the Google Play Games platform
		PlayGamesPlatform.Activate();
	}
Exemplo n.º 27
0
 public void SendScore()
 {
     HScore = PlayerPrefs.GetInt ("HighScore");
     if (PlayGamesPlatform.Instance.localUser.authenticated) {
         PlayGamesPlatform.Instance.ReportScore (HScore, "CgkIjb_-z4oaEAIQBg", (bool success) => {
             PlayGamesPlatform.Instance.ShowLeaderboardUI ("CgkIjb_-z4oaEAIQBg");
         });
     } else {
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();
         GooglePlayGames.PlayGamesPlatform.InitializeInstance (config);
         //GooglePlayGames.PlayGamesPlatform.DebugLogEnabled = true;
         GooglePlayGames.PlayGamesPlatform.Activate ();
         PlayGamesPlatform.Instance.localUser.Authenticate((bool success) => {
             PlayGamesPlatform.Instance.ReportScore (HScore, "CgkIjb_-z4oaEAIQBg", (bool success2) => {
                 PlayGamesPlatform.Instance.ShowLeaderboardUI ("CgkIjb_-z4oaEAIQBg");
             });
         });
     }
 }
	// Use this for initialization
	void Start () {

		PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
			// enables saving game progress.
			.EnableSavedGames()
			.Build();
		PlayGamesPlatform.InitializeInstance(config);
		// recommended for debugging:
		PlayGamesPlatform.DebugLogEnabled = true;
		// Activate the Google Play Games platform
		PlayGamesPlatform.Activate();

		//login
		Social.localUser.Authenticate((bool success) => {
			if(success){
				ConsoleLog.SLog("login Success");
			} else {
				ConsoleLog.SLog("login Fail");
			}
		});
	}
        void Start()
        {
            // Lock the screen to landscape
            Screen.orientation = ScreenOrientation.LandscapeLeft;

            // Buttons
            signedInObjects = GameObject.FindGameObjectsWithTag("SignedIn");
            signedOutObjects = GameObject.FindGameObjectsWithTag("SignedOut");
            statusText = GameObject.Find("statusText").GetComponent<Text>();

            // Google Play Games
            PlayGamesClientConfiguration config = 
                new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.Activate();

            // Try silent sign-in
            UpdateButtonVisibility(false);
            PlayGamesPlatform.Instance.Authenticate(SignInCallback, true);
        }
Exemplo n.º 30
0
    void Start()
    {
        //GOOGLE
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ()
        //			 enables saving game progress.
        //.EnableSavedGames()
        //				 registers a callback to handle game invitations received while the game is not running.
        //						.WithInvitationDelegate(<callback method>)
        //				 registers a callback for turn based match notifications received while the
        //				 game is not running.
        //						.WithMatchDelegate(<callback method>)
        .Build ();
        PlayGamesPlatform.InitializeInstance (config);
        // recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = true;
        // Activate the Google Play Games platform
        PlayGamesPlatform.Activate ();
        ((PlayGamesPlatform)Social.Active).SetDefaultLeaderboardForUI ("CgkIneal8pETEAIQBg");

        StartCoroutine (DisplayScene ());
    }
Exemplo n.º 31
0
    public void Authenticate()
    {
        if (Authenticated || mAuthenticating)
        {
            Debug.LogWarning("Ignoring repeated call to Authenticate().");
            return;
        }

        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            .EnableSavedGames()
            .Build();
        PlayGamesPlatform.InitializeInstance(config);

        // Activate the Play Games platform. This will make it the default
        // implementation of Social.Active
        PlayGamesPlatform.Activate();

        // Sign in to Google Play Games
        mAuthenticating = true;
        Social.localUser.Authenticate((bool success) =>
        {
            mAuthenticating = false;
            if (success)
            {
                // if we signed in successfully, load data from cloud
                Debug.Log("Login successful!");
                Application.LoadLevel("Main Menu");
            }
            else
            {
                // no need to show error message (error messages are shown automatically
                // by plugin)
                Debug.LogWarning("Failed to sign in with Google Play Games.");
                Application.LoadLevel("Main Menu");
            }
        });
    }
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            // enables saving game progress
            //.EnableSavedGames()
            .Build();
        PlayGamesPlatform.InitializeInstance(config);
        //PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate((bool success) => {
            //handle success or failure of signing in
            if (success)
            {
                Debug.Log("Signin Success");
                if(success)
                {
                    if(PlayerPrefs.GetInt("ppFirstPlay") == 0)
                    {
                        PlayerPrefs.SetInt("ppFirstPlay" , 1);
                    }
                }
            }
            else
            {
                Debug.Log("Signin Failed");
            }
        });

        ((PlayGamesLocalUser)Social.localUser).GetStats((rc , stats) =>
                                                        {
            if(rc <= 0){
                Debug.Log("It has been " + stats.DaysSinceLastPlayed + " days");
            }
        });
    }
 private PlayGamesClientConfiguration(PlayGamesClientConfiguration.Builder builder)
 {
     this.mEnableSavedGames   = builder.HasEnableSaveGames();
     this.mInvitationDelegate = builder.GetInvitationDelegate();
     this.mMatchDelegate      = builder.GetMatchDelegate();
 }
Exemplo n.º 34
-1
    void Start()
    {
        // screen should never sleep
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        if (Application.loadedLevelName == "Start")
        {
            AdBuddizBinding.SetAndroidPublisherKey("04476a21-0939-4292-b065-ab1e098d9a86");
            AdBuddizBinding.CacheAds();

            Life.numberOfLives = 3;
            Score.scoreNumber = 0;

            // Google Play Service

            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()

            // require access to a player's Google+ social graph to sign in
            .RequireGooglePlus()
            .Build();

            PlayGamesPlatform.InitializeInstance(config);
            // recommended for debugging:
            PlayGamesPlatform.DebugLogEnabled = true;
            // Activate the Google Play Games platform
            PlayGamesPlatform.Activate();

            // authenticate user:
            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                    Debug.Log("You logged in successfully");
            });
        }
    }