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); }); }
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"); }); }
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"); }); }
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); }
void SaveLevel() { var azure = new AzureMobileServices(_azureEndPoint, _applicationKey); var data = new LevelSaveData() { SaveData = SavePositions(), Id = 1 }; azure.Update <LevelSaveData>(data); }
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]; } } }); }
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!"; }); }
//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); }); } }
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"); }); }
// 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); }
// 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); }
// 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); }
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); }
public void OnConnectButtonClicked() { AzureMobileServices.Connect("https://build16gameazurelab2.azurewebsites.net"); }
// 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"); }
public void LoginAzure() { azure = new AzureMobileServices(AzureEndPoint, ApplicationKey); }
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); }
/// <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); }