public bool AddEffect(float percent, float time) { if (effects.Count < 1) { effects.Add(new Temporary(my_panel, type, percent, time, type.ToString() + count.ToString(), true)); count++; return(true); } else { //do a scale bounce visual thing on the effects that are already in place Debug.Log("Already using 2 effects on " + this.name + "\n"); foreach (Temporary t in effects) { t.Blink(); } return(false); } }
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 InitWish(WishType wishtype, int count) { this.wishtype = wishtype.ToString(); this.count = count; }