private static void ProcessBake() { if (_processed == null) { _processed = new HashSet <IBakeable>(); } MonoBehaviour[] monoBehaviours = Object.FindObjectsOfType <MonoBehaviour>(); foreach (MonoBehaviour mb in monoBehaviours) { if (mb == null) { continue; } if (PrefabUtility.GetPrefabType(mb) == PrefabType.Prefab) { continue; } IBakeable bakeable = mb as IBakeable; if (bakeable != null && !_processed.Contains(bakeable)) { _processed.Add(bakeable); bakeable.Bake(); } } }
public void TakeOutOfOven(IBakeable item) { if (ThingsInOven.Contains(item)) { ThingsInOven.Remove(item); Console.WriteLine("Took a {0} out of the oven", item.Name); } else { Console.WriteLine("There is no {0} in the oven", item.Name); } }
public void PutInOven(IBakeable item) { Console.WriteLine("Put a {0} into the oven", item.Name); ThingsInOven.Add(item); }