Exemplo n.º 1
0
        void OnTriggerExit(Collider other)
        {
            TakeMeHomeTube tube = other.gameObject.GetComponent <TakeMeHomeTube>();

            if (!tube)
            {
                return;
            }
            popTube(tube);

            /*
             *          Debug.Log("exiting: " + other.gameObject.name);
             *         // if (!isDraggable) return;
             *
             *          TakeMeHomeTube tube = other.gameObject.GetComponent<TakeMeHomeTube> ();
             *          if(tube)
             *          {
             *              tube.deactivate();
             *              Debug.Log("exiting tube: " + tube.gameObject.name);
             *          }
             *
             *
             *
             *          if (!tube || lastTube != tube)
             *              return;
             *          if (lastTube) lastTube.deactivate();
             *          lastTube = null;*/
        }
Exemplo n.º 2
0
        void popTube(TakeMeHomeTube tube)
        {
            tube.deactivate();
            collidedTubes.Remove(tube);

            if (collidedTubes.Count > 0)
            {
                collidedTubes[collidedTubes.Count - 1].activate();
            }
        }
Exemplo n.º 3
0
        void OnTriggerEnter(Collider other)
        {
            if (isResetting)
            {
                return;
            }

            TakeMeHomeTube tube = other.gameObject.GetComponent <TakeMeHomeTube>();

            if (!tube || collidedTubes.IndexOf(tube) != -1)
            {
                return;
            }

            if (collidedTubes.Count > 0)
            {
                collidedTubes[collidedTubes.Count - 1].deactivate();
            }

            collidedTubes.Add(tube);
            tube.activate();

            /*
             *          if (!dragging) {
             *              if (lastTube) lastTube.deactivate();
             *              lastTube = null;
             *              return;
             *          }
             *
             *          TakeMeHomeTube tube = other.gameObject.GetComponent<TakeMeHomeTube> ();
             *          if (!tube)
             *              return;
             *          Debug.Log("entering tube: " + tube.gameObject.name);
             *          if (lastTube) lastTube.deactivate();
             *          lastTube = tube;
             *
             *
             *          tube.shake ();
             *          tube.activate();*/
        }