public static string GetUsername(ENUM_LOGIN_TYPE type_) { //string _key = string.Format("{0}:{1}", m_username_keys[type_], GlobalInfo.SERVER_ADDRESS); string _key = string.Format("{0}", m_username_keys[type_]); if (PlayerPrefs.HasKey(_key)) { return(PlayerPrefs.GetString(_key)); } return(null); }
public static void SetUsername(string user_name_, ENUM_LOGIN_TYPE type_) { //string _key = string.Format("{0}:{1}", m_username_keys[type_], GlobalInfo.SERVER_ADDRESS); string _key = string.Format("{0}", m_username_keys[type_]); if (string.IsNullOrEmpty(user_name_)) { PlayerPrefs.DeleteKey(_key); } else { PlayerPrefs.SetString(_key, user_name_); } }
public void SetData(float screen, int index, float space, ENUM_LOGIN_TYPE loginType) { Widget.localPosition = new Vector3(screen + index * (150 + space), 24f, 0); //Widget.localPosition.y //m_TweenPos.ResetAndPlay(); m_TweenPos.From = Widget.localPosition; m_TweenPos.To = new Vector3(index * (150 + space), Widget.localPosition.y, 0); m_TweenPos.Delay = m_TweenPos.Delay * index; m_Index = index; if (loginType == ENUM_LOGIN_TYPE.E_THIRD) { m_Index--; } m_loginType = loginType; }
public void SetType(GuidStartCartoonType type, float m_screenX, long ID) { m_GuidID = ID; cartoonType = type; if (type == GuidStartCartoonType.HEAD) { //GameEvents.UIEvents.UI_StartCartoon_Event.OnNextBtnVisible.SafeInvoke(false,0); ENUM_LOGIN_TYPE loginType = ENUM_LOGIN_TYPE.E_GUEST; if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD)) { loginType = ENUM_LOGIN_TYPE.E_THIRD; } int headCount = CommonData.CartoonHEAD.Count; Transform headRoot = gameObject.transform.Find("Panel (1)/Panel"); this.m_TweenHead = headRoot.GetComponent <TweenScale>(); this.m_IconTex = Make <GameNetworkRawImage>("icon"); this.m_IconTween = m_IconTex.GetComponent <TweenScale>(); Material mat = new Material(ShaderModule.Instance.GetShader("SeekerGame/ImageBlur")); mat.SetFloat("_BlurRadius", 1.5f); bgTexture = Make <GameTexture>("RawImage"); bgTexture.RawImage.material = mat; m_HeadCon = Make <GameUIContainer>("Panel:grid"); m_gridValue = m_HeadCon.GetComponent <GridValue>(); float gridWidth = headCount * 150 + m_gridValue.m_spacing * (headCount - 1); m_HeadCon.Widget.sizeDelta = new Vector2(gridWidth, m_HeadCon.Widget.sizeDelta.y); m_HeadCon.EnsureSize <GuidHeadUILogic>(headCount); for (int i = 0; i < headCount; i++) { GuidHeadUILogic head = m_HeadCon.GetChild <GuidHeadUILogic>(i); head.SetData(m_screenX, i, m_gridValue.m_spacing, loginType); head.Visible = true; } } else if (type == GuidStartCartoonType.NAME) { m_InputName = Make <GameInputField>("Panel (1):RawImage:InputField"); m_InputName.Text = "Guest_" + GlobalInfo.MY_PLAYER_ID; m_effect = Make <GameUIEffect>("Panel (1):RawImage:Effect:UI_xinshouyindao_shou"); m_effect.EffectPrefabName = "UI_xinshouyindao_shou.prefab"; m_effect.Visible = true; GameEvents.UIEvents.UI_StartCartoon_Event.OnNextBtnVisible.SafeInvoke(false, 1); m_InputName.AddClickCallBack(InputClick); } }