Ejemplo n.º 1
0
        protected override void initWidget()
        {
            foreach (RectTransform child in this.transform)
            {
                var layer = child.GetComponent <TezLayer>();
                if (layer != null)
                {
                    this.addLayer(layer);
                }
            }

            TezLayer.sortLayers();
        }
Ejemplo n.º 2
0
        private Window createWindow <Window>(Window prefab
                                             , string name
                                             , TezLayer layer
                                             , TezWidgetLife life) where Window : TezWindow, ITezSinglePrefab
        {
            TezWindow window = null;

            switch (life)
            {
            case TezWidgetLife.Normal:
                window = Instantiate(prefab, layer.transform, false);
                break;

            case TezWidgetLife.TypeOnly:
                TezBaseWidget widget = null;
                var           type   = typeof(Window);
                if (m_WidgetWithType.TryGetValue(type, out widget))
                {
                    widget.reset();
                    return((Window)widget);
                }
                else
                {
                    window = Instantiate(prefab, layer.transform, false);
                    m_WidgetWithType.Add(type, window);
                }
                break;

            default:
                break;
            }

            int id = this.giveID();

            window.windowID   = id;
            window.windowName = name;
            window.layer      = layer;
            window.life       = life;

            m_WindowList[id] = window;
            return((Window)window);
        }
Ejemplo n.º 3
0
 public Window createWindow <Window>(TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) where Window : TezWindow, ITezSinglePrefab
 {
     return(this.createWindow <Window>(typeof(Window).Name, layer, life));
 }
Ejemplo n.º 4
0
 public TezWindow createWindow(TezWindow prefab, TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal)
 {
     return(this.createWindow(prefab, prefab.GetType().Name, layer, life));
 }
Ejemplo n.º 5
0
 public Window createWindow <Window>(string name, TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) where Window : TezWindow, ITezSinglePrefab
 {
     return(this.createWindow(TezcatFramework.prefabDatabase.get <Window>(), name, layer, life));
 }
Ejemplo n.º 6
0
 public Widget createWidget <Widget>(TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) where Widget : TezBaseWidget, ITezSinglePrefab
 {
     return(this.createWidget <Widget>(layer.rectTransform, life));
 }
Ejemplo n.º 7
0
 public void addLayer(TezLayer layer)
 {
     TezLayer.register(layer);
 }