Ejemplo n.º 1
0
    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();
            }
        }
    }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public void PutInOven(IBakeable item)
 {
     Console.WriteLine("Put a {0} into the oven", item.Name);
     ThingsInOven.Add(item);
 }