public void ShowDialog(UIName dialogName, UIShowType showType = UIShowType.Normal) { AssignLayer(showType); GameObject dialogObject = null; if (m_rgCacheUIController != null) { if (m_rgCacheUIController.ContainsKey(dialogName)) { dialogObject = m_rgCacheUIController[dialogName].gameObject; } } if (dialogObject == null) { string uiprefabpath = UIRegister.GetUIPath(dialogName); if (!string.IsNullOrEmpty(uiprefabpath)) { GameObject uiprefab = Resources.Load <GameObject>(uiprefabpath); dialogObject = GameObject.Instantiate(uiprefab, Vector3.zero, Quaternion.identity, m_UILayers[m_iCurUILayer]); dialogObject.SetActive(false); } } UIController tmp = dialogObject.GetComponent <UIController>(); if (tmp == null) { Debug.Log("UI Root Node Can Not Find UIController! UIName: " + dialogName); return; } if (!m_rgCacheUIController.ContainsKey(dialogName)) { m_rgCacheUIController.Add(dialogName, tmp); } OnShowDialog(tmp, showType); }
void Start() { LoadConfigs(); //加载配置表 UIRegister.RegisterUI(); PreLoad(); ///预加载资源放这里 UIManager.Instance.ShowWindow(UIConstant.LOGINWINDOW); //GameMapManger.Instance.LoadScene(ConS0t r.ARSCENE); }
public async Task <HttpResponseMessage> Register([FromBody] UIRegister model) { if (_db.Users.Where(x => x.Username == model.Username).FirstOrDefault() != null) { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "User with that username already exists!")); } Users newUser = new Users { FirstName = model.FirstName, LastName = model.LastName, Email = model.Email, PositionID = 5, Skills = model.Skills, RegisterDate = DateTime.Now, IsDeleted = false, Position = model.Position, Username = model.Username, PasswordSalt = PasswordHelper.GenerateSalt(), }; newUser.PasswordHash = PasswordHelper.GenerateHash(newUser.PasswordSalt, model.Password); string location = Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath(ConfigurationManager.AppSettings["ProfilePhotos"].ToString())); try { model.photo = Convert.FromBase64String(model.stringPhoto); File.WriteAllBytes(location + newUser.Username + ".jpg", model.photo); newUser.ProfilePhotoPath = ConfigurationManager.AppSettings["ProfilePhotosForDB"].ToString() + newUser.Username + ".jpg"; } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } try { _db.Users.Add(newUser); _db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, newUser)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }
protected override void OnInit() { UIRegister.RegisterUI(); SwitchState(GameStartState.Instance); }
private void Awake() { uigesiter = GetComponent <UIRegister>(); }
public void OnClickWantRegister() { UIRegister.Show(); Close(); }
private void Awake() { UIRegister.RegistAll(); }
private void Awake() { instance = this; }