Пример #1
0
    private void OnTriggerStay(Collider other)
    {
        Collectible  collectibleCol = other.GetComponent <Collectible>();
        LevainScript levainCol      = other.GetComponent <LevainScript>();
        DoughMaker   doughMakerCol  = other.GetComponent <DoughMaker>();
        Hoven        hovenCol       = other.GetComponent <Hoven>();
        Dispenser    dispenserCol   = other.GetComponent <Dispenser>();
        Counter      counterCol     = other.GetComponent <Counter>();

        //LEVAIN
        if (levainCol != null)
        {
            if (isHolding && !isPourring)
            {
                canFeed = true;
                Hud.OpenLevainPanel("Press E to feed " + currentCollectibeType);
            }
            else
            {
                Hud.OpenLevainPanel("Press E to collect starter");
                canCollect = true;
            }
        }

        //DOUGH
        if (doughMakerCol != null)
        {
            if (isHolding && !isPourring)
            {
                canAddIngredient = true;
                Hud.OpenDoughMakerPanel("Press E to add " + currentCollectibeType);
            }
            else
            {
                Hud.OpenDoughMakerPanel("Press E to collect dough");
                canCollectDough = true;
            }
        }

        //HOVEN
        if (hovenCol != null)
        {
            if (isHolding && !isPourring && currentCollectibeType == CollectibleType.Dough)
            {
                canPutDoughHoven = true;
                Hud.OpenHovenMakerPanel("Press E to add bread");
            }
            else
            {
                Hud.OpenHovenMakerPanel("Press E to collect bread");
                canCollectBread = true;
            }
        }

        //COUNTER
        if (counterCol != null)
        {
            if (isHolding && !isPourring)
            {
                canSell = true;
                Hud.OpenCounterPanel();
            }
        }

        //COLLECT
        if (collectibleCol != null)
        {
            Pickable  = collectibleCol.gameObject;
            canPickUp = true;
            Hud.OpenPickUpPanel(collectibleCol.type.ToString(), collectibleCol.gameObject);
        }

        //DISPENSER
        if (dispenserCol != null)
        {
            Dispenser = dispenserCol.gameObject;
            canOrder  = true;
            Hud.OpenDispenserPanel(dispenserCol.type.ToString());
        }
    }