void OnTriggerEnter(Collider collider)
 {
     if (collider.name.Contains("Container"))
     {
         ContainerChildBehaviour cont = collider.GetComponent <ContainerChildBehaviour>();
         {
             if (MainBehaviour.Instance.state == MainState.Filled)
             {
                 cont.container.state = ContainerBehaviour.ContainerState.Returned;
             }
         }
     }
 }
Exemplo n.º 2
0
    void OnTriggerEnter(Collider triggerer)
    {
        if (triggerer.name.Contains("Container"))
        {
            ContainerChildBehaviour cont = triggerer.GetComponent <ContainerChildBehaviour>();

            if (MainBehaviour.Instance.state == MainState.Filling && !this.tube.isFilled())
            {
                cont.container.setTubeTip(this.transform.position);
                cont.container.setPouringPosition(pouringPosition.position);
                cont.container.setFilledTube(tube);

                cont.container.state = ContainerBehaviour.ContainerState.Pouring;
            }
        }
    }