public void setAction(BubbleAction action, bool negated) { this.action = action; this.negated = negated; switch (action) { case BubbleAction.Wardrobe: Animation = "wardrobe"; break; case BubbleAction.Portrait: Animation = "portrait"; break; case BubbleAction.OldPortrait: Animation = "oldportrait"; break; case BubbleAction.Push: Animation = "push"; break; case BubbleAction.Chair: Animation = "chair"; break; case BubbleAction.Stair: Animation = "stair"; break; case BubbleAction.Bookcase: Animation = "bookcase"; break; default: Animation = "negate"; break; } }
void Action() { GameObject action = GameObject.Find("WallSpawner"); BubbleAction consequence = action.GetComponent <BubbleAction> (); if (!wasCorrect) { consequence.Punish(); } else { GameObject[] allTrash = GameObject.FindGameObjectsWithTag("Trash"); GameObject[] allOil = GameObject.FindGameObjectsWithTag("Oil"); if (allTrash.Count() >= 10) { consequence.Reward(allTrash); } else if (allOil.Count() >= 5) { consequence.Reward(allOil, "Oil"); } else { TroutControl.healFish(); } } }
public ActionBubble() { this.sheet = sheetMan.getSheet("action"); this.action = BubbleAction.None; visible = false; negated = false; if (sheet.hasAnimation("negate")) { negateInd = sheet.getAnimation("negate").First(); } }