Ejemplo n.º 1
0
    private void _OpenWindow(WindowController winCtrl, BaseOpenWindowParams param)
    {
        foreach (var p in _plugins)
        {
            p.OnWillOpenWindow(winCtrl, winCtrl.Window);
        }


        //some strategy to show window
        winCtrl.Window.gameObject.SetActive(true);
        var tr = winCtrl.Window.gameObject.transform;

        tr.localPosition = Vector3.zero;
        tr.localScale    = Vector3.one;
        var rectTr = tr as RectTransform;

        rectTr.sizeDelta = Vector2.zero;

        winCtrl.OnWindowOpen(param);
        _openedWindowDict.Add(winCtrl.WinMetaInfo.WindowID, winCtrl);


        foreach (var p in _plugins)
        {
            p.OnDidOpenWindow(winCtrl, winCtrl.Window);
        }
    }
Ejemplo n.º 2
0
    public WindowController OpenWindow(string winId, BaseOpenWindowParams param = null)
    {
        WindowController winCtrl;

        if (_aliveWindowDict.TryGetValue(winId, out winCtrl))
        {
            if (_openedWindowDict.ContainsKey(winId))
            {
                return(winCtrl);
            }
            else
            {
                //reopen it
                _OpenWindow(winCtrl, param);
            }

            return(winCtrl);
        }

        WindowMetaInfo metaInfo;

        if (_metaInfoDict.TryGetValue(winId, out metaInfo))
        {
            winCtrl = CreateWindowController(metaInfo);
            winCtrl.OnInit(metaInfo);

            winCtrl.OnWindowWillCreate();


            foreach (var p in _plugins)
            {
                p.OnWillCreateWindow(winCtrl, null);
            }


            var win = CreateWindow(metaInfo);
            winCtrl.OnWindowCreated(win);
            _aliveWindowDict.Add(winId, winCtrl);


            foreach (var p in _plugins)
            {
                p.OnWindowCreated(winCtrl, win);
            }


            _OpenWindow(winCtrl, param);

            return(winCtrl);
        }
        else
        {
            throw new WindowMetaInfoNotFoundException();
        }
    }
Ejemplo n.º 3
0
 public virtual void OnWindowOpen(BaseOpenWindowParams param)
 {
 }
Ejemplo n.º 4
0
 public void OpenWindowAsync(string winId, System.Object token, BaseOpenWindowParams param = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
    public override void OnWindowOpen(BaseOpenWindowParams param)
    {
        base.OnWindowOpen(param);

        Debug.Log("open window: shop win");
    }