Example #1
0
    void _itpAddItemToShow(object oitemDatas, string loadPrefabKey = "", Callback overMethod = null)
    {
        if (string.IsNullOrEmpty(loadPrefabKey))
        {
            Debug.LogError("Miss load prefab key.");
            //	yield return 0;
        }
        if (!string.IsNullOrEmpty(curPrefabPath) && curPrefabPath != loadPrefabKey)
        {
            return;
        }
        curPrefabPath = loadPrefabKey;
        int   curExistChildCount = mTrans_.childCount;
        IList refreshItems       = ( IList )oitemDatas;

        WUIManager.GetSignleAsset(WUIManager.hlpGetUIPath(loadPrefabKey), delegate(Object prefabObj) {
            ObjectCache itemObj     = null;
            itemObj                 = ObjectCachePool.instance.ocpNew <ObjectCache>(prefabObj.name, prefabObj as GameObject, mTrans_, Vector3.zero);
            itemObj.gameObject.name = string.Format("{0}{1}", itemSlotName, curExistChildCount++);
            itemList.Add(itemObj);
            ((IPanelItem)itemObj).itemRefresh(refreshItems[refreshItems.Count - 1]);
            StartCoroutine(_itpWaitFinished(delegate {
                if (overMethod != null)
                {
                    overMethod();
                }
            }));
        });
    }
Example #2
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()     //Awake
 {
     if (WUIManager.instance == null)
     {
         WUIManager.instance = this;
     }
     windowTypeToRootMaps_[WindowType.WT_LOADING] = GameObject.Find("UIRoot/Canvas/" + WindowType.WT_LOADING.ToString()).transform;
     windowTypeToRootMaps_[WindowType.WT_PANEL]   = GameObject.Find("UIRoot/Canvas/" + WindowType.WT_PANEL.ToString()).transform;
     windowTypeToRootMaps_[WindowType.WT_WINDOW]  = GameObject.Find("UIRoot/Canvas/" + WindowType.WT_WINDOW.ToString()).transform;
     windowTypeToRootMaps_[WindowType.WT_HINT]    = GameObject.Find("UIRoot/Canvas/" + WindowType.WT_HINT.ToString()).transform;
     windowTypeToRootMaps_[WindowType.WT_EFFECT]  = GameObject.Find("UIRoot/Canvas/" + WindowType.WT_EFFECT.ToString()).transform;
 }
Example #3
0
    public static void UIMClosePanel(bool isPlayAnimation = false)
    {
        WUIManager.UIMCloseAllWindow();
        GameObject willClose = UIMGetOpened(WUIManager.currentPanel);

        if (willClose != null)
        {
            Window willCloseComp = willClose.GetComponent <Window>();
            willCloseComp.close(isPlayAnimation);
        }
        WUIManager.currentPanel = null;
    }
Example #4
0
    public static void UIMShowHintWindow()
    {
        GameObject topWindow = WUIManager.UIMGetCurrentTopUI(true);

        if (topWindow != null)
        {
            if (topWindow.name == "InformWindow")
            {
                //refresh
                return;
            }
        }
        // show window
    }
Example #5
0
 void _itpLoadRes(string loadPrefabKey, Callback <Object> cb)
 {
     if (preloadItemObj != null && curPrefabPath == loadPrefabKey)
     {
         cb(preloadItemObj);
     }
     else
     {
         preloadItemObj = null;
         WUIManager.GetSignleAsset(WUIManager.hlpGetUIPath(loadPrefabKey), delegate(Object prefabObj){
             preloadItemObj = prefabObj as GameObject;
             cb(prefabObj);
         });
     }
 }
Example #6
0
    void _itpAddItemsToShow(object oitemDatas, string loadPrefabKey = "", Callback overMethod = null)
    {
        if (string.IsNullOrEmpty(loadPrefabKey))
        {
            Debug.LogError("Miss load prefab key.");
        }
        if (!string.IsNullOrEmpty(curPrefabPath) && curPrefabPath != loadPrefabKey)
        {
            return;
        }
        int   curExistChildCount = mTrans_.childCount;
        IList refreshItems       = ( IList )oitemDatas;
        int   idx = curExistChildCount;

        WUIManager.GetSignleAsset(WUIManager.hlpGetUIPath(loadPrefabKey), delegate(Object prefabObj) {
            ObjectCache itemObj = null;
            for (int i = 0; i < refreshItems.Count; ++i)
            {
                itemObj = ObjectCachePool.instance.ocpNew <ObjectCache>(prefabObj.name, prefabObj as GameObject, mTrans_, Vector3.zero);
                itemObj.gameObject.name = string.Format("{0}{1}", itemSlotName, curExistChildCount++);
                if (autoLayout)
                {
                    if (pivot == Pivot.Horizontal)
                    {
                        itemObj.mTrans.localPosition = new Vector3(cellWidth * idx, 0, 1);
                    }
                    else
                    {
                        itemObj.mTrans.localPosition = new Vector3(0, -cellHeight * idx, 1);
                    }
                }
                itemList.Add(itemObj);
                ((IPanelItem)itemObj).itemRefresh(refreshItems[i]);
                idx++;
            }
            if (overMethod != null)
            {
                overMethod();
            }
        });
    }
Example #7
0
 public void OnPointerClick(PointerEventData eventData)
 {
     WUIManager.UIMCloseWindow(playTween: playAni);
 }
Example #8
0
File: Window.cs Project: wluluxiu/W
 public virtual bool onCancelTriggerFunc()
 {
     WUIManager.UIMCloseWindow(windowName);
     return(true);
 }
Example #9
0
 public virtual void OnLoadingDone()
 {
     ProgressFill.fillAmount = 1;
     WUIManager.UIMCloseLoading();
 }