private void Start()
        {
            // Create the delays so they only have to be made once.
            m_StartWait = new WaitForSeconds(m_StartDelay);
            m_EndWait   = new WaitForSeconds(m_EndDelay);

            SpawnAllTanks();
            SetCameraTargets();

            // Once the tanks have been created and the camera is using them as targets, start the game.
            StartCoroutine(GameLoop());

            //BUILD16 Connect to Azure
            Debug.Log("Logging into Azure...");
            AzureMobileServices.Connect("https://build16gameazurelab3.azurewebsites.net");

            //BUILD16 Save initial game score in Azure
            userId = System.Guid.NewGuid().ToString();
            GameScore score = new GameScore {
                user = userId, score = 0
            };

            AzureMobileServices.Insert <GameScore>(score, (response) =>
            {
                if (response.Status == CallbackStatus.Failure)
                {
                    Debug.LogError("Inserting record failed.");
                    Debug.LogError(response.Exception.ToString());
                    return;
                }

                // print something
                Debug.Log("Successfully inserted item " + score.id);
            });
        }
Example #2
0
    public void OnFacebookAuthButtonClicked()
    {
        Debug.Log("In Facebook auth button clicked");
        AzureMobileServices.Connect("https://unitypluginstest.azure-mobile.net/", "cbdWXFvfYQsNLApFEnoRJnFoZzPWPS37");
        AzureMobileServices.AuthenticateWithServiceProvider(MobileServiceAuthenticationProvider.Facebook, (response) =>
        {
            if (response.Status == CallbackStatus.Failure)
            {
                Debug.LogError("AuthenticateWithServiceProvider failed.");
                Debug.LogError(response.Exception.ToString());
                return;
            }

            FacebookAuthText.text = "authenticating";
            serviceUser           = response.Result;
            Debug.Log("Authentication Suceeded");
            FacebookAuthText.text = "authentication succeeded!";
        });
    }
    public void OnFacebookAuthButtonClicked()
    {
        Debug.Log("In Facebook auth button clicked");
        AzureMobileServices.Connect("https://build16gameazurelab2.azurewebsites.net");
        AzureMobileServices.AuthenticateWithServiceProvider(MobileServiceAuthenticationProvider.Facebook, (response) =>
        {
            if (response.Status == CallbackStatus.Failure)
            {
                Debug.LogError("AuthenticateWithServiceProvider failed.");
                Debug.LogError(response.Exception.ToString());
                return;
            }

            FacebookAuthText.text = "authenticating";
            serviceUser           = response.Result;
            Debug.Log("Authentication Suceeded");
            FacebookAuthText.text = "authentication succeeded!";
        });
    }
Example #4
0
 public void OnConnectButtonClicked()
 {
     AzureMobileServices.Connect("https://unitypluginstest.azure-mobile.net/", "cbdWXFvfYQsNLApFEnoRJnFoZzPWPS37");
 }
 public void OnConnectButtonClicked()
 {
     AzureMobileServices.Connect("https://build16gameazurelab2.azurewebsites.net");
 }