Ejemplo n.º 1
0
 private void OnSliceableDrop(Placeable sliceable, Receivable r, bool inRange)
 {
     if (inRange && !activeMenu)
     {
         droppedBaguette = true;
         HandleProcessingOptions(sliceable as Sliceable);
     }
     else
     {
         sliceable.ReturnToInitialPosition();
     }
 }
Ejemplo n.º 2
0
        private void OnPlaceableDrop(Placeable placeable, Receivable r, bool inRange)
        {
            if (inRange && !activeMenu)
            {
                int accum = 1;
                if (addedItems.ContainsKey(placeable.name))
                {
                    accum += addedItems[placeable.name];
                }
                addedItems[placeable.name] = accum;
                if (ingredientDestination)
                {
                    placeable.MoveToPosition(ingredientDestination.position);
                }
                else
                {
                    placeable.MoveToReceiverPosition();
                }

                // Only getting single prep step for all eggs, as it seems
                // redundant to allow seperate preparation for each one
                if (placeable.name == "Egg" && !prepSteps.ContainsKey("Egg"))
                {
                    eggPrep.Show();
                    activeMenu = true;
                    droppedEgg = true;
                }
                else if (placeable.name == "Garlic" && !prepSteps.ContainsKey("Garlic"))
                {
                    garlicPrep.Show();
                    activeMenu    = true;
                    droppedGarlic = true;
                }
                else if (placeable.name == "Lettuce leaf" && !prepSteps.ContainsKey("Lettuce leaf"))
                {
                    lettucePrep.Show();
                    activeMenu     = true;
                    droppedLettuce = true;
                }
            }
            else
            {
                placeable.ReturnToInitialPosition();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// We've asked our outgoing connection pin
        /// to notify us when it's dropped. We confirm
        /// it's a Connectable (which should be a given)
        /// then check if it's dropped on a ConnectionReceiver.
        /// If so, clear any existing connection from either
        /// terminal and form a new connection. If it's
        /// dropped outside of a receiver proximity,
        /// clear the outgoing connection if any and
        /// remove connection line.
        /// </summary>
        /// <param name="p"></param>
        /// <param name="r"></param>
        /// <param name="inProximity"></param>
        private void CallOnDrop(Placeable p, Receivable r, bool inProximity)
        {
            Connectable conn = p as Connectable;

            if (conn)
            {
                Debug.Log("Dropped connector");

                ConnectionReceiver receiver = r as ConnectionReceiver;

                if (receiver && inProximity)
                {
                    SetConnection(receiver.connection);
                }
                else
                {
                    ClearOutgoingConnection();
                }
            }

            p.ReturnToInitialPosition();
        }
Ejemplo n.º 4
0
 private void OnPourDrop(Placeable placeable, Receivable r, bool inRange)
 {
     placeable.ReturnToInitialPosition();
 }