void SetItem2(BaseBrainItem i) { RemoveItem2(); var c = Instantiate <BaseBrainItem> (i, Item2Slot); i.CopyTo(c); Item2 = c; Item2Slot.GetComponent <Button> ().enabled = true; }
public void RemoveItem1() { if (!Item1) { return; } Destroy(Item1.gameObject); Item1 = null; Item1Slot.GetComponent <Button> ().enabled = false; Refresh(); }
public void AddItem(BaseBrainItem item) { if ((Item1 != null && Item1.Equals(item)) || (Item2 != null && Item2.Equals(item))) { return; } else if (item is UIHypothesisItem && Item2 is UIHypothesisItem) { SetItem2(item); } else if (item is UIHypothesisItem && Item1 is UIHypothesisItem) { SetItem1(item); } else if (Item1 == null) { SetItem1(item); } else if (Item2 == null) { SetItem2(item); } else if (item is UIFactItem && Item2 is UIHypothesisItem) { SetItem1(item); } else if (item is UIFactItem && Item1 is UIHypothesisItem) { SetItem2(item); } else { SetItem2(item); } Refresh(); }
public abstract void CopyTo(BaseBrainItem other);
public override void CopyTo(BaseBrainItem other) { (other as UIFactItem).Fact = Fact; }
public override void CopyTo(BaseBrainItem other) { (other as UIHypothesisItem).Hypothesis = Hypothesis; }