/* Player picks up the key */ private void OnTriggerEnter(Collider coll) { //coll = GetComponent<Collider> (); if (coll.gameObject == player) { playClip = true; if (clock == null && GetComponent <Timer> () != null) { clock = GetComponent <Timer> (); } currentLevel = SceneManager.GetActiveScene().name; //attempts = handler.getAttempts (); timeToComplete = (int)clock.getTotalSeconds(); string path = currentLevel + ".Attempts.KeysCollected.Time"; UpdateProgress.ProgressUpdate(path, attempts, timeToComplete); GetPlayerData.GetData(attempts, timeToComplete, 1); // DoBeep(); diamond.SetActive(false); print("Key has been picked up 1"); level2.displayPopUp(); } }
void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }
public object Get(GetPlayerData request) { var data = new PlayerData() { Player = Db.GetById <Player>(request.PlayerId), Links = Db.Where <ItemLink>(x => x.ItemType == ItemType.Player).ToList(), PlayerTags = Db.Where <PlayerTag>(x => x.PlayerId == request.PlayerId).ToList(), }; data.Tags = Db.Where <Tag>(x => data.PlayerTags.Select(t => t.TagId).Contains(x.Id)).ToList(); return(data); }
/// <summary> /// Called by the End of Day Panel when the player clicks Continue and is used /// to continue the game into the next day. Responsible for saving and unpausing /// the game after this event. /// </summary> public void ContinueGame() { GetPlayerData.Save(); UnpauseGame(); }
void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; soundManager = new SoundManager(); } else if (instance != this) { Destroy(gameObject); } #if !UNITY_EDITOR && UNITY_WEBGL isMobile = IsPhoneDetected(); string browserVersion = GetBrowserVersion(); // check if we are running on Internet Explorer 11 if (browserVersion.IndexOf("Trident") > -1) { IsRunningIE = true; Debug.Log("GameControl.browserVersion: " + browserVersion); } // if (browserVersion == "IE") Debug.Log("GameControl.browserVersion: " + browserVersion); // else Debug.Log("GameControl.browserVersion: " + browserVersion); #endif if (isDevelopment) { //SaveDataURL = "SaveData.php"; RootURL = "http://localhost:8080/apps/bridgestone/TriviaPHP/api/"; ImageRootURL = "http://localhost:8080/apps/bridgestone/TriviaPHP/images/"; URL = Application.absoluteURL; // Cleave's server // RootURL = "http://50.73.103.10/trivia/leaderboard/"; } else { // RootURL = "https://www.lms.mybridgestoneeducation.com/TriviaPHP/__staging/api/"; RootURL = "https://www.lms.mybridgestoneeducation.com/TriviaPHP/__staging/api/"; ImageRootURL = "https://www.lms.mybridgestoneeducation.com/TriviaPHP/__staging/images/"; URL = Application.absoluteURL; } GetPlayerData.GetURLData(); if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(email) && !String.IsNullOrEmpty(region) && !String.IsNullOrEmpty(org)) { //Debug.Log ("IsNullOrEmpty"); if (!IsEmail(email)) { //Debug.Log ("INVALID EMAIL"); StartCoroutine(ShowAlertPanel("INVALID EMAIL")); } else { UpdateUserProfileToServer(); } } else { // something has happened with the user's profile - we need to get 4 properties. // if any of these are missing we need to let the user know // check each property //print ("username: "******" len: " + username.Length); if (String.IsNullOrEmpty(username) && String.IsNullOrEmpty(email) && String.IsNullOrEmpty(region) && String.IsNullOrEmpty(org)) { StartCoroutine(ShowAlertPanel("MISSING USER INFO")); } else if (String.IsNullOrEmpty(username)) { StartCoroutine(ShowAlertPanel("MISSING USERNAME")); } else if (String.IsNullOrEmpty(email)) { StartCoroutine(ShowAlertPanel("MISSING EMAIL")); } else if (String.IsNullOrEmpty(region) || String.IsNullOrEmpty(org)) { StartCoroutine(ShowAlertPanel("MISSING REGION/STATE")); } } }