Пример #1
0
        void OnTriggerExit(Collider other)
        {
            TakeMeHomeTube tube = other.gameObject.GetComponent <TakeMeHomeTube>();

            if (!tube)
            {
                return;
            }
            lastCollidedTube = null;
            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;*/
        }
        public void EnterState()
        {
            //create a random LL and make it move:
            if (counter == 0)
            {
                counter++;
                TakeMeHomeConfiguration.Instance.Context.GetAudioManager().PlayDialogue(Database.LocalizationDataId.TakeMeHome_Tuto, () => {
                    game.currentLetter.sayLetter();
                });
            }


            //find which tube belongs to current letter:
            foreach (UnityEngine.GameObject go in this.game.activeTubes)
            {
                if (go.name == "tube_" + this.game.currentTube)
                {
                    tube = go.GetComponent <TakeMeHomeTube>();
                    break;
                }
            }

            if (tube == null)
            {
                return;
            }

            timer = 2;
        }
Пример #3
0
        void popTube(TakeMeHomeTube tube)
        {
            tube.deactivate(this);
            collidedTubes.Remove(tube);

            if (collidedTubes.Count > 0)
            {
                collidedTubes[collidedTubes.Count - 1].activate(this);
            }
        }
Пример #4
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(this);
            }

            lastCollidedTube = tube;
            collidedTubes.Add(tube);
            tube.activate(this);

            /*
             *          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();*/
        }