void Awake() { _instance = this; UIManager.Instance.OpenUI(EnumUIType.FixedUI); UIManager.Instance.OpenUI(EnumUIType.OneUI); UIManager.Instance.OpenUI(EnumUIType.TwoUI, 1024); }
// Use this for initialization void Start() { GameObject tmpGo = gameObject; Action <SceneContinue> tmpCb = callBack; Action initCb = delegate() { GameObject go = GameObject.Instantiate(tmpGo); Scene scene = go.GetComponent <Scene>(); if (scene != null) { scene.resetWhenDisable = false; GameObject.Destroy(scene); } Light light = go.GetComponentInChildren <Light>(); if (light != null) { GameObject.Destroy(light); } go.name = COPY_NAME; go.transform.SetParent(tmpGo.transform.parent, false); GameObjectControl control = go.GetComponent <GameObjectControl>(); if (control != null && control.delUseNum != null) { control.delUseNum = null; } SceneContinue sceneContinue = tmpGo.AddComponent <SceneContinue>(); sceneContinue.SetCopy(go); go.SetActive(false); if (tmpCb != null) { tmpCb(sceneContinue); } }; SuperTween.Instance.DelayCall(0, initCb); GameObject.Destroy(this); }
private static Action GetCallBack(GameObject _go) { Action callBack = delegate() { GameObject go = GameObject.Instantiate(_go); GameObjectControl control = go.GetComponent <GameObjectControl>(); if (control != null && control.delUseNum != null) { control.delUseNum = null; } SceneContinue sceneContinue = _go.AddComponent <SceneContinue>(); sceneContinue.Init(go); }; return(callBack); }
static Action GetCallBack(GameObject _go) { Action callBack = delegate() { GameObject go = GameObject.Instantiate(_go); GameObjectControl control = _go.GetComponent <GameObjectControl>(); if (control != null) { GameObjectControl newControl = go.GetComponent <GameObjectControl>(); newControl.unit = control.unit; newControl.AddUseNum(); } SceneContinue sceneContinue = _go.AddComponent <SceneContinue>(); sceneContinue.Init(go); }; return(callBack); }
// 所有的角色都加载完毕 public void OnAllActorLoaded() { if (SelectActorScene.Instance != null) { ResetPos(); } UIManager.GetInstance().ShowLoadingBK(false); if (!IsShow) { return; } int index = mSelectIndex; mSelectIndex = -1; OnClickActor(index); //test //Game.Instance.GameObjectControl.scene.SetActive(false); //Game.Instance.GameObjectControl.uiPanel.SetActive(true); if (AuditManager.Instance.AuditAndIOS() && SDKHelper.GetSwitchModel()) { GameObjectControl control = Game.Instance.GameObjectControl; if (control != null) { if (control.scene != null && control.uiPanel != null) { control.scene.SetActive(!AuditManager.Instance.Open); control.uiPanel.SetActive(AuditManager.Instance.Open); } } } }
//-------------------------------------------------------- // 内部调用 //-------------------------------------------------------- IEnumerator WaitActorLoad() { while (CreateActorScene.Instance == null || CreateActorScene.Instance.LoadFinish == false || CreateActorScene.Instance.TimelinesIsLoadFinished == false) { yield return(null); } var isAuditAndIos = AuditManager.Instance.AuditAndIOS(); if (!isAuditAndIos || (isAuditAndIos && !SDKHelper.GetSwitchModel())) { var preload_infos = DBPreloadInfo.Instance.PreloadInfos; if (preload_infos.Count > 0) { mPreloadAssetResource.Clear(); foreach (var info in preload_infos) { var object_asset = new AssetResource(); mPreloadAssetResource.Add(object_asset); MainGame.HeartBehavior.StartCoroutine(SGameEngine.ResourceLoader.Instance.load_asset("Assets/" + info.asset_path, typeof(UnityEngine.Object), object_asset)); } float star_wait_time = Time.unscaledTime; // 等待所有资源加载完毕 while (true) { // 最多等待20s if (Time.unscaledTime - star_wait_time > 20.0f) { Debug.LogError("WaitActorLoad: wait preload asset for long time"); break; } bool all_loaded = true; foreach (var info in mPreloadAssetResource) { if (info.asset_ == null) { all_loaded = false; break; } } if (all_loaded) { break; } else { yield return(null); } } } } if (AuditManager.Instance.AuditAndIOS() && SDKHelper.GetSwitchModel()) { GameObjectControl control = Game.Instance.GameObjectControl; if (control != null) { if (control.scene != null && control.uiPanel != null) { control.scene.SetActive(!AuditManager.Instance.Open); control.uiPanel.SetActive(AuditManager.Instance.Open); } } } //int[] actorList = new int[] { 2, 1, 3 }; if (AuditManager.Instance.AuditAndIOS()) { List <uint> actorList = SDKHelper.GetRoleList(); if (actorList != null && actorList.Count >= 1) { mDefaultSelectIndex = (int)actorList[0]; } } OnClickActorBtn((uint)mDefaultSelectIndex); // 等待一帧才隐藏loading界面,避免播放剧情前穿帮 mHideLoadingBKCoroutine = MainGame.HeartBehavior.StartCoroutine(EndFrameHideLoadingBK()); }