Exemplo n.º 1
0
        private void OnTriggerExit2D(Collider2D other)
        {
            IVegetableVender veggieVender = other.GetComponent <IVegetableVender>();

            if (veggieVender == currentVender)
            {
                currentVender = null;
            }
            IProcessor processor = other.GetComponent <IProcessor>();

            if (processor == currentProcessor)
            {
                currentProcessor = null;
            }
            ITrashCan trashCan = other.GetComponent <ITrashCan>();

            if (currentTrashCan == trashCan)
            {
                currentTrashCan = null;
            }
            IPlateBehaviour plate = other.GetComponent <IPlateBehaviour>();

            if (currentPlate == plate)
            {
                currentPlate = null;
            }
            INpcCustomer npcCustomer = other.GetComponent <INpcCustomer>();

            if (currentCustomer == npcCustomer)
            {
                currentCustomer = null;
            }
        }
Exemplo n.º 2
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            IVegetableVender veggieVender = other.GetComponent <IVegetableVender>();

            if (veggieVender != null)
            {
                currentVender = veggieVender;
            }
            IProcessor processor = other.GetComponent <IProcessor>();

            if (processor != null)
            {
                currentProcessor = processor;
            }
            ITrashCan trashCan = other.GetComponent <ITrashCan>();

            if (trashCan != null)
            {
                currentTrashCan = trashCan;
            }
            IPlateBehaviour plate = other.GetComponent <IPlateBehaviour>();

            if (plate != null)
            {
                currentPlate = plate;
            }
            INpcCustomer npcCustomer = other.GetComponent <INpcCustomer>();

            if (npcCustomer != null)
            {
                currentCustomer = npcCustomer;
            }
        }