Пример #1
0
        public T ShowWindow <T>(string wndName, Fishing.ArgList args, bool fromAssetBundle = true) where T : Window
        {
            GameObject prefab = null;

            if (fromAssetBundle)
            {
                //var layouts = AssetsManager.Instance.GetAssetBundle("layout");
                //prefab = layouts.Load(wndName, typeof(GameObject)) as GameObject;
            }
            else
            {
                prefab = Resources.Load("UI/" + wndName, typeof(GameObject)) as GameObject;
            }
            var go = Instantiate(prefab) as GameObject;

            go.transform.SetParent(transform);
            var rt = go.transform as RectTransform;

            Helper.Normalize(rt);
            //rt.offsetMin = Vector2.zero;
            //rt.offsetMax = Vector2.zero;
            T t = go.AddComponent <T>();

            //T t = go.AddComponent(System.Type.GetType(/*this.strNamespace + */wndName)) as T;
            t.gameObject.name = wndName;
            t.Show(args);
            _window = t;
            return(t);
        }
Пример #2
0
 public override void Show(Fishing.ArgList args)
 {
     base.Show(args);
     this._tfgInside = transform.FindChild("imginside").GetComponent <RectTransform>();
     this._tfOutSide = transform.FindChild("imgoutside").GetComponent <RectTransform>();
     this._tfMiddle  = transform.FindChild("imgmiddle").GetComponent <RectTransform>();
     this._tfJiantou = transform.FindChild("jiantou").GetComponent <RectTransform>();
     this._jiantou2  = transform.FindChild("jiantou2").GetComponent <RectTransform>();
     this._jiantou3  = transform.FindChild("jiantou3").GetComponent <RectTransform>();
     this._btnClick  = transform.FindChild("btnClick").GetComponent <Button>();
     //this._btnClick.onClick.AddListener(this.OnClick);
     this._startPos = args.GetAt <Vector3>(0);
     //this._endPos = args.GetAt<Vector3>(1);
     this._layer1   = args.GetAt <int>(1);
     this._layer2   = args.GetAt <int>(2);
     this._layer3   = args.GetAt <int>(3);
     this._callBack = args.GetAt <Action>(4);
     if (this._layer1 >= 60 && this._layer1 <= 90)
     {
         this._layer2 = this._layer1;
         this._layer1 = 0;
     }
     else if (this._layer1 >= 100 && this._layer1 <= 150)
     {
         this._layer3 = this._layer1;
         this._layer1 = 0;
     }
     this._btnClick.SetActive(false);
     this.Init();
 }
Пример #3
0
        public T PopupWindow <T>(Fishing.ArgList args) where T : Window
        {
            T t = ShowWindow <T>(args);

            //BoxCollider bc = NGUITools.AddWidgetCollider(t.gameObject);
            //bc.center = new Vector3(bc.center.x, bc.center.y, 1);
            //bc.size = new Vector3(5000, 5000, 1);
            return(t);
        }
Пример #4
0
        public override void Show(Fishing.ArgList args)
        {
            base.Show(args);
            Text messageText = transform.FindChild("message").GetComponent <Text>();

            messageText.text = args.GetAt <string>(0);
            RectTransform rt = transform.GetComponent <RectTransform>();

            rt.localPosition = new Vector3(0, 250, 0);
            messageText.DOFade(0, 2).OnComplete(Close);
        }
Пример #5
0
 public virtual void Show(Fishing.ArgList args)
 {
 }
Пример #6
0
 public T ShowWindow <T>(Fishing.ArgList args, bool fromAssetBundle = true) where T : Window
 {
     return(ShowWindow <T>(typeof(T).ToString(), args, fromAssetBundle));
 }
Пример #7
0
 public override void Show(Fishing.ArgList args)
 {
     base.Show(args);
     _slider = transform.FindChild("Slider").GetComponent <Slider>();
     SetSlider(0.0f);
 }