コード例 #1
0
        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);
            });
        }
コード例 #2
0
    public void OnWhereButtonClicked()
    {
        if (serviceUser == null)
        {
            FacebookAuthText.text = "Please authenticate before using futher scenarios!";
            return;
        }

        TodoItem item1 = new TodoItem {
            Complete = false, Text = "Todo Updated", Id = "5a34a00d8ef34630b6fe19e0e2c31b8b"
        };

        AzureMobileServices.Where <TodoItem>(item => item.Text.Contains("Updated"), (response) =>
        {
            if (response.Status == CallbackStatus.Failure)
            {
                Debug.LogError("Where record failed.");
                Debug.LogError(response.Exception.ToString());
                return;
            }


            // print something
            FacebookAuthText.text = "Successfully looked up item by where";
            Debug.Log("Successfully looked up item by where");
        });
    }
コード例 #3
0
    public void OnDeleteButtonClicked()
    {
        if (serviceUser == null)
        {
            FacebookAuthText.text = "Please authenticate before using futher scenarios!";
            return;
        }

        TodoItem item1 = new TodoItem {
            Complete = false, Text = "Todo Updated", Id = this.id
        };

        AzureMobileServices.Delete <TodoItem>(item1, (response) =>
        {
            if (response.Status == CallbackStatus.Failure)
            {
                Debug.LogError("Deleting record failed.");
                Debug.LogError(response.Exception.ToString());
                return;
            }

            // print something
            FacebookAuthText.text = "Successfully deleted item";
            Debug.Log("Successfully deleted item");
        });
    }
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: kungfubozo/WinBridge
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            string AzureEndPoint = "https://unityleaderboard.azure-mobile.net/";
            string ApplicationKey = "sMkhPtZJYlndEGAWTxxKoOfadQIvmo27";

            azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);

            azure.Where<LeaderBoard>(p => p.UserName != null, ReadHandler);
        }
コード例 #5
0
    void SaveLevel()
    {
        var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);
        var data  = new LevelSaveData()
        {
            SaveData = SavePositions(), Id = 1
        };

        azure.Update <LevelSaveData>(data);
    }
コード例 #6
0
    void LoadLevel()
    {
        var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);

        azure.Lookup <LevelSaveData>(1, azureResponse =>
        {
            if (azureResponse.Status == AzureResponseStatus.Success)
            {
                var data     = azureResponse.ResponseData;
                var cubeData = JsonConvert.DeserializeObject <List <Vector3> >(data.SaveData);
                for (var i = 0; i < cubeData.Count && i < cubes.Count; i++)
                {
                    cubes[i].position = cubeData[i];
                }
            }
        });
    }
    void LoadLevel()
    {
        var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);

        azure.Lookup<LevelSaveData>(1, azureResponse =>
        {
            if (azureResponse.Status == AzureResponseStatus.Success)
            {
                var data = azureResponse.ResponseData;
                var cubeData = JsonConvert.DeserializeObject<List<Vector3>>(data.SaveData);
                for (var i = 0; i < cubeData.Count && i < cubes.Count; i++)
                {
                    cubes[i].position = cubeData[i];
                }
            }
        });
    }
コード例 #8
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!";
        });
    }
コード例 #10
0
        //BUILD16 - method to save score
        private void SaveScoreInAzure()
        {
            if (m_RoundWinner != null)
            {
                GameScore score = new GameScore {
                    user = userId, tank = m_RoundWinner.m_PlayerNumber, score = m_RoundWinner.m_Wins
                };
                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);
                });
            }
        }
コード例 #11
0
    public void OnLookupButtonClicked()
    {
        if (serviceUser == null)
        {
            FacebookAuthText.text = "Please authenticate before using futher scenarios!";
            return;
        }

        string id = "5a34a00d8ef34630b6fe19e0e2c31b8b";;

        AzureMobileServices.Lookup <TodoItem>(id, (response) =>
        {
            if (response.Status == CallbackStatus.Failure)
            {
                Debug.LogError("Lookup record failed.");
                Debug.LogError(response.Exception.ToString());
                return;
            }

            // print something
            FacebookAuthText.text = "Successfully looked up item";
            Debug.Log("Successfully looked up item");
        });
    }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);
     score = PlayerPrefs.GetInt("Score");
     if (PlayerPrefs.GetInt("isAlliance") == 1)
     {
         faction = "Alliance";
     }
     else
     {
         faction = "Federation";
     }
 }
 void SaveLevel()
 {
     var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);
     var data = new LevelSaveData() { SaveData = SavePositions(), Id = 1 };
     azure.Update<LevelSaveData>(data);
 }
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);
     azure.LoginAsync(AuthenticationProvider.Facebook, MyCallback);
 }
コード例 #15
0
ファイル: AzureUI.cs プロジェクト: schoolsout/Schools-Out
 // Use this for initialization
 void Start()
 {
     azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);
 }
コード例 #16
0
        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);

            azure.LoginAsync(AuthenticationProvider.Facebook, MyCallback);
        }
コード例 #17
0
ファイル: AzureUI.cs プロジェクト: eranshac/PitchFor4
 // Use this for initialization
 void Start()
 {
     azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);
 }
 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);
     azure.LoginAsync(AuthenticationProvider.Facebook, MyCallback);
 }
コード例 #19
0
 public void OnConnectButtonClicked()
 {
     AzureMobileServices.Connect("https://unitypluginstest.azure-mobile.net/", "cbdWXFvfYQsNLApFEnoRJnFoZzPWPS37");
 }
    // Setup the UI, get the list item creator, create azure instance
    void Start()
    {
        updatePanel.SetActive(false);

        endpointText.text = AzureEndPoint;
        appKeyText.text = ApplicationKey;

        createStatusText.text = "";
        updateStatusText.text = "";

        listItemCreator = FindObjectOfType<ListItemCreator>();

        azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);
    }
コード例 #21
0
 public void OnConnectButtonClicked()
 {
     AzureMobileServices.Connect("https://build16gameazurelab2.azurewebsites.net");
 }
コード例 #22
0
 // Use this for initialization
 void Start ()
 {
     // Connect to the Block Party service
     //Service = new AzureMobileServices("http://localhost:49753", "tEtsHvgLHoRZKUATnELAkzCLWXARVl99");
     Service = new AzureMobileServices("http://blockparty.azure-mobile.net", "tEtsHvgLHoRZKUATnELAkzCLWXARVl99");
 }
コード例 #23
0
ファイル: LayerMoreGame.cs プロジェクト: IoT-Experts/Panda
 public void LoginAzure()
 {
     azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);
 }
コード例 #24
0
ファイル: User.cs プロジェクト: schoolsout/Schools-Out
    void Awake()
    {
        azure = new AzureMobileServices(AzureEndPoint, ApplicationKey);

        if (user == null)
        {
            DontDestroyOnLoad(gameObject);
            user = this;
        }
        else if (user != this)
        {
            Destroy(gameObject);
        }

        azure.LoginAsync(AuthenticationProvider.Facebook, FacebookAccessToken, LoginAsyncCallback);
    }
コード例 #25
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var azure = new AzureMobileServices(_azureEndPoint, _applicationKey);

            azure.LoginAsync(AuthenticationProvider.Facebook, MyCallback);
        }