protected override void initWidget() { foreach (RectTransform child in this.transform) { var layer = child.GetComponent <TezLayer>(); if (layer != null) { this.addLayer(layer); } } TezLayer.sortLayers(); }
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); }
public Window createWindow <Window>(TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) where Window : TezWindow, ITezSinglePrefab { return(this.createWindow <Window>(typeof(Window).Name, layer, life)); }
public TezWindow createWindow(TezWindow prefab, TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) { return(this.createWindow(prefab, prefab.GetType().Name, layer, life)); }
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)); }
public Widget createWidget <Widget>(TezLayer layer, TezWidgetLife life = TezWidgetLife.Normal) where Widget : TezBaseWidget, ITezSinglePrefab { return(this.createWidget <Widget>(layer.rectTransform, life)); }
public void addLayer(TezLayer layer) { TezLayer.register(layer); }