Exemplo n.º 1
0
    public void RecycleScene(InDoorElement inDoorElement)
    {
        string key = inDoorElement.ElementInDoorInfo.name;

        if (inDoorTypesDict.ContainsKey(key))
        {
            inDoorTypesDict[key].RecycleSceneElement(inDoorElement);
        }
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 public void RecycleSceneElement(InDoorElement sceneElement)
 {
     for (int i = inDoorElements.Count - 1; i >= 0; i--)
     {
         if (inDoorElements[i].ElementInDoorInfo == sceneElement.ElementInDoorInfo)
         {
             return;
         }
     }
     inDoorElements.Add(sceneElement);
 }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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));
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
    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);
    }
Exemplo n.º 8
0
    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);
    }