1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- /****************************
- summary:
- ****************************/
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SettingSocketUrl : MonoBehaviour
- {
- public SCButton button;
- public TextMesh text;
- public GameObject settingUrl;
- private int clickNum =0;
- private void Start()
- {
- button.onClick.AddListener(OpenOnClick);
-
- if(PlayerPrefs.HasKey("SocketUrl"))
- {
- if(PlayerPrefs.GetInt("SocketUrl") ==1)
- {
- GameEnum.ServerHttpURL = "http://10.81.9.12:3437/server/"; // 本地
- text.text = "当前版本为:本地";
- }
- else
- {
- GameEnum.ServerHttpURL = "http://office.ghz-tech.com:3437/server/"; // 云端
- text.text = "当前版本为:云端";
- }
- }
- else
- {
- PlayerPrefs.SetInt("SocketUrl", 1);
- text.text = "当前版本为:本地";
- }
- }
- private void OpenOnClick()
- {
- clickNum++;
- if(clickNum>5)
- {
- clickNum = 0;
- settingUrl.SetActive(true);
- Debug.Log("打开 Url设置");
- }
- }
- public void SetUrl( int num)
- {
- if(num == 1)
- {
- GameEnum.ServerHttpURL = "http://10.81.9.12:3437/server/"; // 本地
- text.text = "当前版本为:本地";
- }
- else
- {
- GameEnum.ServerHttpURL = "http://office.ghz-tech.com:3437/server/"; // 云端
- text.text = "当前版本为:云端";
- }
- PlayerPrefs.SetInt("SocketUrl", num);
- }
- }
|