Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 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));
            }
        }
Exemplo n.º 4
0
 protected override void OnInit()
 {
     UIRegister.RegisterUI();
     SwitchState(GameStartState.Instance);
 }
Exemplo n.º 5
0
 private void Awake()
 {
     uigesiter = GetComponent <UIRegister>();
 }
Exemplo n.º 6
0
 public void OnClickWantRegister()
 {
     UIRegister.Show();
     Close();
 }
Exemplo n.º 7
0
 private void Awake()
 {
     UIRegister.RegistAll();
 }
Exemplo n.º 8
0
 private void Awake()
 {
     instance = this;
 }