public override void Receive(InteractiveElement element) { base.Receive(element); if (element is ToppingInteractiveElement topping) { StartCoroutine(nameof(Interact), topping); } }
public override void Receive(InteractiveElement element) { if (element is PlateInteractiveElement plate) { HasContent = true; CanInteractWith = false; AudioManager.PlaySound(SFXSound); _gameManager.OnOrderCompleted(this); _gameManager.AddScore(CalculateScore(plate)); StartCoroutine(nameof(Consume)); } }
public override bool CanReceive(InteractiveElement element) { if (!CanInteractWith) { return(false); } switch (element.GetElementType) { case ElementType.PlateStack: if (HasPlate) { return(false); } break; case ElementType.Broth: if (HasBroth || !HasPlate) { return(false); } break; case ElementType.Strainer: if (HasNoodles || !HasPlate) { return(false); } break; case ElementType.CuttingBoard: if (!HasPlate || !HasBroth || !HasNoodles) { return(false); } break; default: return(false); } return(true); }
public override bool CanReceive(InteractiveElement element) => true;
public override void Receive(InteractiveElement element) { base.Receive(element); switch (element.GetElementType) { case ElementType.PlateStack: Image.sprite = LastSprite = plate; HasPlate = true; HasContent = true; break; case ElementType.Broth: if (element is BrothInteractiveElement brothElement) { BrothType = brothElement.GetBrothType; Sprite brothSprite; if (!HasNoodles) { brothSprite = BrothType == BrothType.Shio ? plateWithClearBroth : plateWithDarkBroth; } else { brothSprite = BrothType == BrothType.Shio ? plateWithClearBrothWithNoodles : plateWithDarkBrothWithNoodles; } Image.sprite = LastSprite = brothSprite; HasBroth = true; } break; case ElementType.Strainer: Sprite noodlesSprite; if (!HasBroth) { noodlesSprite = plateWithNoodles; } else { noodlesSprite = BrothType == BrothType.Shio ? plateWithClearBrothWithNoodles : plateWithDarkBrothWithNoodles; } Image.sprite = LastSprite = noodlesSprite; HasNoodles = true; break; case ElementType.CuttingBoard: if (element is CuttingBoardInteractiveElement cuttingBoard && !ToppingTypes.Contains(cuttingBoard.ToppingType)) { ToppingTypes.Add(cuttingBoard.ToppingType); Image.sprite = LastSprite = MergeSprites(Image.sprite, cuttingBoard.ToppingFinalSprite); } break; } }
public override void Receive(InteractiveElement element) { base.Receive(element); StartCoroutine(nameof(Interact)); }
public virtual bool CanReceive(InteractiveElement element) => CanInteractWith && !HasContent;
public virtual void Receive(InteractiveElement element) { }
public override bool CanReceive(InteractiveElement element) => CanInteractWith && !HasContent;