Пример #1
0
    void Update()
    {
        RaycastHit hit;

        if (Input.GetMouseButtonDown(0) &&
            PlayerInteracter.Instance.grabbing &&
            Physics.Raycast(PlayerInteracter.Instance.interactiveRay, out hit) &&
            hit.collider.GetComponentInParent <Dishwasher>())
        {
            Mixer mixer = PlayerInteracter.Instance.selected.GetComponent <Mixer>();
            if (mixer)
            {
                mixer.Empty();
            }
        }
    }
Пример #2
0
    void Update()
    {
        RaycastHit hit;

        if (Input.GetMouseButtonDown(0) &&
            PlayerInteracter.Instance.grabbing &&
            Physics.Raycast(PlayerInteracter.Instance.interactiveRay, out hit) &&
            hit.collider.GetComponentInParent <GlassInteraction>() == this &&
            Mixer.Instance.LiquidAmount > 0.1f)
        {
            Mixer mixer = PlayerInteracter.Instance.selected.GetComponent <Mixer>();
            if (!mixer)
            {
                return;
            }

            TriggerEvaluation();
            glass.FillWith(mixer.material.color);
            mixer.Empty();
        }
    }