public void RemoveLabel(GenericPanel my_panel) { my_panel.RemoveLabel(label.content); //label.SetActive(false); Zoo.Instance.returnObject(label.gameObject, true); }
public void getLabel(GenericPanel panel) { foreach (MyLabel l in panel.list) { if (!l.gameObject.activeSelf) { label = l; // Debug.Log("reusing label\n"); l.SetActive(true); return; } } // Debug.Log("getting new label\n"); label = Zoo.Instance.getObject("GUI/VariableStatVertical", true).GetComponent <MyLabel>(); }
public virtual void SetCurrentPanel(GenericPanel panel) { if (!xorPanels.Contains(panel)) { Debug.LogError("SetCurrentPanel not valid " + panel.gameObject.name); return; } GenericPanel oldPanel = currentPanel; currentPanel = panel; foreach (GenericPanel p in xorPanels) { p.Show(p == panel); } onPanelChanged.Invoke(oldPanel, currentPanel); }
private void Start() { foreach (PanelBehaviour panel in panels) { switch (panel.Name) { case "GenericPanel": genericPanel = (GenericPanel)panel; break; case "GenericPanelSmall": genericPanelSmall = (GenericPanel)panel; break; case "TimedBaseGenericPanel": timedBaseGenericPanel = (TimedBaseGenericPanel)panel; break; } } }
public Temporary(GenericPanel panel, WishType type, float _percent, float _time, string label_name, bool has_label) { percent = _percent; remaining_time = _time; if (has_label) { getLabel(panel); label.content = label_name; label.gameObject.name = label_name; Sprite sp = Resources.Load("GUI/Inventory/" + type.ToString() + "_image", typeof(Sprite)) as Sprite; label.image.sprite = sp; panel.AddLabel(label, true, true); panel.UpdatePanel(); Blink(); } else { Debug.Log("Has no label!\n"); } }
public void SetPanel(GenericPanel panel) { my_panel = panel; }