public static StartCoroutine ( IEnumerator routine, Func |
||
routine | IEnumerator | |
done | Func |
|
Результат | void |
public static void SendEvent(string eventID) { GA_Submit.CategoryType category = GA_Submit.CategoryType.GA_Event; List <GA_Submit.Item> queue = new List <GA_Submit.Item>(); Hashtable parameters = new Hashtable() { { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.EventID], eventID }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Level], "Unity Editor" }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.UserID], _userID }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.SessionID], _sessionID }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Build], GA_Settings.VERSION } }; queue.Add(new GA_Submit.Item() { AddTime = 0, Count = 1, Type = category, Parameters = parameters }); Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> > dict = new Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> >(); dict.Add(category, queue); WWW www = GetEventWWW(category, parameters); GA_ContinuationManager.StartCoroutine(GA_Submit.SendWWW(www, Submitted, SubmitError, true, "", "", queue), () => www.isDone); }
public static void RunCoroutine(IEnumerator routine, Func <bool> done) { if (!Application.isPlaying && Application.isEditor) { #if UNITY_EDITOR GA_ContinuationManager.StartCoroutine(routine, done); #endif } else { GA_controller.RunCoroutine(routine); } }
public static void SendUserEvent() { GA_Submit.CategoryType category = GA_Submit.CategoryType.GA_User; string os = ""; string[] osSplit = SystemInfo.operatingSystem.Split(' '); if (osSplit.Length > 0) { os = osSplit[0]; } #if UNITY_IPHONE bool idfa = CheckIDFA(); #endif List <GA_Submit.Item> queue = new List <GA_Submit.Item>(); Hashtable parameters = new Hashtable() { { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Platform], GA_GenericInfo.GetSystem() }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Device], SystemInfo.deviceModel }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Os], os }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.OsVersion], SystemInfo.operatingSystem }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Sdk], "GA Unity SDK " + GA_Settings.VERSION }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallPublisher], "UnityVersion:" + UnityEditorInternal.InternalEditorUtility.GetFullUnityVersion() }, #if UNITY_IPHONE { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallSite], "IDFA:" + idfa.ToString() }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallCampaign], "iAD:" + EditorPrefs.GetBool("GA_IAD" + "-" + Application.dataPath, GA_Settings.IAD_DEFAULT) }, #endif #if UNITY_IPHONE || UNITY_ANDROID { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallAdgroup], "Chartboost:" + EditorPrefs.GetBool("GA_CB" + "-" + Application.dataPath, GA_Settings.CB_DEFAULT) }, #endif { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.UserID], _userID }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.SessionID], _sessionID }, { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Build], GA_Settings.VERSION } }; queue.Add(new GA_Submit.Item() { AddTime = 0, Count = 1, Type = category, Parameters = parameters }); Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> > dict = new Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> >(); dict.Add(category, queue); WWW www = GetEventWWW(category, parameters); GA_ContinuationManager.StartCoroutine(GA_Submit.SendWWW(www, Submitted, SubmitError, true, "", "", queue), () => www.isDone); }
private static void GetUpdateChanges() { WWW www = new WWW("https://s3.amazonaws.com/public.gameanalytics.com/sdk_status/change_logs.json"); GA_ContinuationManager.StartCoroutine(CheckWebChanges(www), () => www.isDone); }
public static void CheckForUpdates() { WWW www = new WWW("https://s3.amazonaws.com/public.gameanalytics.com/sdk_status/current.json"); GA_ContinuationManager.StartCoroutine(CheckWebUpdate(www), () => www.isDone); }
private static void GetUpdateChanges() { WWW www = new WWW("https://s3.amazonaws.com/download.gameanalytics.com/sdk_status/latest_changes/unity.txt"); GA_ContinuationManager.StartCoroutine(CheckWebChanges(www), () => www.isDone); }