Example #1
0
        /*
         * 登录:
         * account:账号
         * password:密码
         */
        /// <summary>
        /// 获取登录
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public string GetLogin(string account, string password)
        {
            string value  = "";
            bool   on_off = login(account, password);

            if (on_off)
            {
                getuserinfo = Getinfos(account);
                if (getuserinfo["Role"] != "0")
                {
                    Debug.Log(CG_Config.LABEL["DLCG"]);
                    value = "1";
                }
                else
                {
                    Debug.Log(CG_Config.LABEL["MYJS"]);
                    value = "2";
                }
            }
            else
            {
                Debug.LogError(CG_Windows.Format((string)CG_Config.LABEL["DLSB"], account, password));
                Debug.LogError(CG_Config.LABEL["ZHMMYW"]);
                value = "0";
            }
            return(value);
        }
Example #2
0
 /// <summary>
 /// 切换场景
 /// </summary>
 /// <param name="SceneName">场景名字</param>
 public void LoadLevel(string scenename)
 {
     UI_Manage.CreateInstance().emptyUI();
     SceneName = scenename;
     EditorSceneManager.LoadScene("Scene_Loading");
     Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["QHCJ"], "Scene_Loading"));
 }
Example #3
0
        /*
         * 更改及更新用户属性V值:
         * id:用户ID
         * key:K值属性
         * Value:V值属性
         */
        /// <summary>
        ///  更改及更新用户属性V值:
        /// </summary>
        public void SetInfo(string id, string key, string Value)
        {
            bool on_off = UpdateInfoXml(id, key, Value);

            if (on_off)
            {
                getuserinfo[key] = Value;
                Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["GXCG"], key, getuserinfo[key]));
                return;
            }
            Debug.LogError(CG_Windows.Format((string)CG_Config.LABEL["GXSB"], id, key));
        }
Example #4
0
        /// <summary>
        /// 获取UI最大层级
        /// </summary>
        /// <returns></returns>
        public int GetMaxZOrder()
        {
            List <int> list = new List <int>();
            UIPanel    Panel;

            foreach (KeyValuePair <string, GameObject> index in getuiid)
            {
                Panel = index.Value.GetComponent <UIPanel>();
                list.Add(Panel.depth);
            }
            return(CG_Windows.GetMax(list));
        }
Example #5
0
        /*
         * 获取用户所有属性:
         * account:用户账户
         */
        /// <summary>
        /// 获取用户所有属性
        /// </summary>
        /// <param name="account">用户账户</param>
        /// <returns></returns>
        public Dictionary <string, string> Getinfos(string account)
        {
            Dictionary <string, string> Object = new Dictionary <string, string>();

            Object = FindAllInfo(account);
            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["Begin"]));
            foreach (KeyValuePair <string, string> index in Object)
            {
                Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["YHSX"], index.Key, index.Value));
            }
            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["END"]));
            return(Object);
        }
Example #6
0
    public void AddInfo(JsonData info)
    {
        int         index     = 0;
        IDictionary infoValue = info as IDictionary;

        Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["ZRJSSX"]));
        Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["Begin"]));
        foreach (var obj in infoValue.Values)
        {
            userdata.SetInfo(User_Manage.GetUserInfo[userdata.GetKey_ID], userdata.GetModelKeys[index], obj.ToString());
            index++;
        }
        Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["END"]));
    }
Example #7
0
        protected Dictionary <string, string> GetInfo(JsonData info)
        {
            Dictionary <string, string> container = new Dictionary <string, string>();
            IDictionary infoKays = info as IDictionary;

            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["ZRDRSX"]));
            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["Begin"]));
            foreach (var obj in infoKays.Keys)
            {
                container.Add((string)obj, (string)info[(string)obj]);
                Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["DRSX"], (string)obj, (string)info[(string)obj]));
            }
            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["BROKEN"], (string)CG_Config.LABEL["END"]));
            return(container);
        }
Example #8
0
        /*
         * 注册:
         * name:名字
         * account:账号
         * password:密码
         */
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="name">名字</param>
        /// <param name="account">账号</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public string GetZhuce(string name, string account, string password)
        {
            string filepath = Application.dataPath + @"/Resources/UserData.xml";
            string on_off   = "1";

            Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["ZC"], name, account, password));
            if (account == "")
            {
                Debug.LogError(CG_Config.LABEL["ZHYW"]);
                on_off = "2";
            }
            else if (password == "")
            {
                Debug.LogError(CG_Config.LABEL["MMYW"]);
                on_off = "3";
            }
            else if (name == "")
            {
                Debug.LogError(CG_Config.LABEL["MZYW"]);
                on_off = "4";
            }
            if (on_off == "1")
            {
                if (!File.Exists(filepath))
                {
                    createXml(name, account, password);
                    Debug.Log(CG_Config.LABEL["ZCCG"]);
                }
                else if (File.Exists(filepath))
                {
                    on_off = AddXml(name, account, password);
                    if (on_off == "5")
                    {
                        Debug.LogError(CG_Config.LABEL["ZHCZ"]);
                    }
                }
                else if (on_off == "1")
                {
                    Debug.Log(CG_Config.LABEL["ZCCG"]);
                }
            }
            return(on_off);
        }
Example #9
0
    void otherOnClickState(string objname)
    {
        Transform Getname = me.transform.Find("ui/name/Label");
        UILabel   name    = Getname.GetComponent <UILabel>();

        switch (objname)
        {
        case "sj":
            string Setname = "";
            int    rand;
            for (int i = 0; i < 3; i++)
            {
                rand     = CG_Windows.Random(0, CG_Config._FIRSTNAME.Length);
                Setname += CG_Config._FIRSTNAME[rand].ToString();
            }
            name.text = Setname;

            break;

        case "ks":
            bool same = userdata.isSame(userdata.GetKey_Name, name.text);
            if (same)
            {
                Debug.LogError(CG_Windows.Format((string)CG_Config.LABEL["JZJSONCG"]));
            }
            else
            {
                userdata.SetInfo(User_Manage.GetUserInfo[userdata.GetKey_ID], userdata.GetKey_Name, name.text);
                userdata.SetInfo(User_Manage.GetUserInfo[userdata.GetKey_ID], userdata.GetKey_Role, job);
                userdata.SetInfo(User_Manage.GetUserInfo[userdata.GetKey_ID], userdata.GetKey_Sex, sex);
                userdata.SetInfo(User_Manage.GetUserInfo[userdata.GetKey_ID], userdata.GetKey_Model, Model);
                Scene_Manage.CreateInstance().LoadLevel("Scene_Game");
            }
            break;
        }
    }
Example #10
0
 public void LoadData()
 {
     Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["JZMXSJ"], ModelData.ToJson()));
 }
Example #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Obj">UI对象</param>
 /// <param name="ClassName">UI类名</param>
 public void removeUI(GameObject Obj, string ClassName)
 {
     MB.MB_Destroy(Obj);
     getuiid.Remove(ClassName);
     Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["REMOVE"], ClassName));
 }