using UnityEngine; using UnityEngine.UI; public class ReadURL : MonoBehaviour { private static string testParameters; public static void Path() { #if UNITY_EDITOR testParameters = ""; #else testParameters = Application.absoluteURL;//https://ukitchenit.com/free/?mt_hb@test.ca #endif if (testParameters != "") { _G.PATH=testParameters; string[] URLSplit=testParameters.Split("?mt_"); if (URLSplit.Length>1) { _G.PATH=URLSplit[0]; _G._mt=URLSplit[1]; } if(_G.PATH.Contains("?")){_G.PATH=URLSplit[0].Split("?")[1];}//https://ukitchenit.com/3d/?kwizine/ else _G.PATH="free";//https://ukitchenit.com/free/ Get.o2("Canvas", "PATH").GetComponent().text = _G.PATH; } } } //private static Dictionary parameters = new Dictionary(); //public static bool HasKey(string key) { return parameters.ContainsKey(key); } //public static string GetValue(string key) { return parameters[key]; } // if (testParameters != "") // { // SetRequestParameters(testParameters); // } // foreach (string param in parameters.Keys) // { // //Debug.Log(param); // if (param == "key") // { // _G._key = GetValue("key"); // Debug.Log("The key = " + _G._key); // } // else if (param == "save") // { // _G._saveLink = GetValue("save"); // Debug.Log("The Link For Saving= " + _G._saveLink); // } // else if (param == "file") // { // _G._file = GetValue("file"); // Debug.Log("The Cieblink File URL= " + _G._file); // UDT // } // else if (param == "mtfile") // { // _G._mtfile = GetValue("mtfile"); // } // else if (param == "mt") // { // _G._mt = GetValue("mt"); // } // else if (param == "room_id") // { // _G._ROOM_ID = GetValue(param); // } // else if (param == "source") // { // _G._SOURCE = GetValue(param); // } // else if(param == "ref_type") // { // _G.ref_type = GetValue(param); // } // else if (param == "ref_id") // { // _G.ref_id = GetValue(param); // } // } // if (_G._key != "") { _G.PATH = _G._key; } // if (_G._mt != "") { _G.PATH = _G._mt; } // if (testParameters.IndexOf("?") != -1 && testParameters.IndexOf("&") == -1 && testParameters.IndexOf("key") == -1) // { // //print("testParameters==="+testParameters);//https://software.ciemetric.com/9987/?template // int index1 = testParameters.IndexOf("?"); // _G.PATH = testParameters.Substring(index1 + 1, testParameters.Length - index1 - 1); // //_G.PATH = _G.PATH.Split("&&mt_")[0]; // } // if (testParameters.IndexOf("?") != -1 && testParameters.IndexOf("&") == -1 && testParameters.IndexOf("key") != -1) // { // //print("testParameters==="+testParameters);//"https://software.ciemetric.com/9990?key=template"; // int index1 = testParameters.IndexOf("?"); // _G.PATH = testParameters.Substring(index1 + 5, testParameters.Length - index1 - 5); // } // if (_G._file != "") // { // Get.o3("Canvas", "Panel_main", "START").SetActive(false); // Get.o3("Canvas", "Panel_main", "OPEN").SetActive(false); // } // if (_G.PATH != null) // { // _G.PATH = _G.PATH.Split("$$mt_")[0]; // Get.o2("Canvas", "PATH").GetComponent().text = _G.PATH; // } //print("_G.PATH ==="+_G.PATH ); // public static void SetRequestParameters(string parametersString) // { // print("pass-------------------------------------SetRequestParameters"); // char[] parameterDelimiters = new char[] { '?', '&' }; // string[] parameters = parametersString.Split(parameterDelimiters, System.StringSplitOptions.RemoveEmptyEntries); // char[] keyValueDelimiters = new char[] { '=' }; // for (int i = 0; i < parameters.Length; ++i) // { // string[] keyValue = parameters[i].Split(keyValueDelimiters, System.StringSplitOptions.None); // if (keyValue.Length >= 2) // { // ReadURL.parameters.Add(UnityWebRequest.UnEscapeURL(keyValue[0]), UnityWebRequest.UnEscapeURL(keyValue[1])); // } // else if (keyValue.Length == 1) // { // ReadURL.parameters.Add(UnityWebRequest.UnEscapeURL(keyValue[0]), ""); // } // } // }