IEnumerator Loading(Action start = default(Action), Action end = default(Action)) { MOperateManager.ActiveHandController(false); int[] nums = Utilitys.GetRandomSequence(LoadData.SpriteDatas.Count, LoadData.loadCount); for (int i = 0; i < nums.Length; i++) { SetBackground(LoadData.SpriteDatas[nums[i]].Value); yield return(new WaitForSeconds(LoadData.loadTime)); if (i == 0 && start != null) { start(); } } MOperateManager.ActiveHandController(true); if (end != null) { end(); yield return(new WaitForSeconds(1.0f)); } }
IEnumerator RandomLoading(float time, float startTime, Action start = default(Action), float endTime = 0.5f, Action end = default(Action), Action endDelay = default(Action)) { MOperateManager.ActiveHandController(false); var value = Utilitys.GetRandomSequence(LoadData.SpriteDatas.Count, 1)[0]; SetBackground(LoadData.SpriteDatas[value].Value); yield return(new WaitForSeconds(startTime)); if (start != null) { start(); } yield return(new WaitForSeconds(time)); if (end != null) { end(); yield return(new WaitForSeconds(endTime)); if (endDelay != null) { endDelay(); } UIManager.Instance.HideUI("Loading"); } MOperateManager.ActiveHandController(true); //UIManager.Instance.HideUI(); }
IEnumerator LoadingKey(string key, Action start = default(Action), Action end = default(Action)) { MOperateManager.ActiveHandController(false); SetBackground(LoadData.SpriteDatas.Find(obj => obj.key.Equals(key)).Value); if (start != null) { start(); } yield return(new WaitForSeconds(LoadData.loadTime)); if (end != null) { end(); yield return(new WaitForSeconds(1.0f)); } MOperateManager.ActiveHandController(true); }