public void RecycleScene(InDoorElement inDoorElement) { string key = inDoorElement.ElementInDoorInfo.name; if (inDoorTypesDict.ContainsKey(key)) { inDoorTypesDict[key].RecycleSceneElement(inDoorElement); } }
public void MovePrevious(int index) { mEnableSwipe = false; mBeforeElement = mCurElement; mCurElement = InDoorPool.Instance.GetSceneWithInDoor(mOrderedInDoorInfos[index]); mCurElement.GetComponent <OnShowCtrl>().OnShowLeft(mDuration); mBeforeElement.GetComponent <OnHideCtrl>().OnHideLeft(mDuration); }
public void RecycleSceneElement(InDoorElement sceneElement) { for (int i = inDoorElements.Count - 1; i >= 0; i--) { if (inDoorElements[i].ElementInDoorInfo == sceneElement.ElementInDoorInfo) { return; } } inDoorElements.Add(sceneElement); }
public InDoorElement AddSceneByType(InDoorInfo activeInfo) { var currentInDoorPrefab = InDoorPool.Instance.ResLoader.LoadSync <GameObject>(Indoorsceneprefab.BundleName, activeInfo.name); GameObject sceneObj = GameObject.Instantiate(currentInDoorPrefab); InDoorElement skuSceneElement = sceneObj.AddComponent <InDoorElement>(); skuSceneElement.ElementInDoorInfo = activeInfo; inDoorElements.Add(skuSceneElement); return(skuSceneElement); }
public void LoadScenes(List <InDoorInfo> orderedSkuActiveInfos, int selectedIndex) { mOrderedInDoorInfos = orderedSkuActiveInfos; mCurElement = InDoorPool.Instance.AddInDoor(orderedSkuActiveInfos[selectedIndex]); if (mCurElement != null) { mCurElement.transform.SetParent(this.transform); } mCurElement.CustomShow(); StartCoroutine(LoadSceneConten(selectedIndex)); }
public void MoveNext(int index) { mEnableSwipe = false; mBeforeElement = mCurElement; mCurElement = InDoorPool.Instance.GetSceneWithInDoor(mOrderedInDoorInfos[index]); mCurElement.GetComponent <OnShowCtrl>().OnShowRight(mDuration); mBeforeElement.GetComponent <OnHideCtrl>().OnHideRight(mDuration); Debug.Log(mBeforeElement.ElementInDoorInfo.id + "---------------" + mCurElement.ElementInDoorInfo.id); }
IEnumerator LoadSceneConten(int selectedIndex) { //yield return null; for (int i = 0; i < mOrderedInDoorInfos.Count; ++i) { if (i != selectedIndex) { yield return(null); InDoorElement inDoorElement = InDoorPool.Instance.AddInDoor(mOrderedInDoorInfos[i]); if (inDoorElement != null) { inDoorElement.transform.SetParent(this.transform); inDoorElement.gameObject.Hide(); } } } mLoadingFinish = true; mEnableSwipe = true; //SendEvent(UISKUMenuEvent.CarLoadFinish); }
public InDoorElement GetInDoorElement(InDoorInfo activeInfo) { bool hasFind = false; for (int i = inDoorElements.Count - 1; i >= 0; i--) { if (inDoorElements[i].ElementInDoorInfo == activeInfo) { InDoorElement sceneElement = inDoorElements[i]; inDoorElements.RemoveAt(i); hasFind = true; return(sceneElement); } } if (!hasFind) { InDoorElement sceneElement = inDoorElements[0]; sceneElement.ElementInDoorInfo = activeInfo; inDoorElements.RemoveAt(0); return(sceneElement); } return(null); }