public override void OnGazeExit(Gazer gazer)
 {
     if (CurrentState == KeypadState.Ready)
     {
         ResetGaze();
     }
 }
 public override void OnGazeExit(Gazer gazer)
 {
     interactive = false;
     if ((labelsAnimation != null) && (labelsAnimation.gameObject.activeInHierarchy == true))
     {
         labelsAnimation.SetInteger(StateField, (int)LabelState.None);
     }
 }
Пример #3
0
 public override void OnGazeEnter(Gazer gazer)
 {
     // Check if the user is holding an item
     if ((IsOpen == false) && (gazer.PlayerHolder.HoldingItem != null))
     {
         IsInteractive = true;
     }
 }
 public override void OnGazeEnter(Gazer gazer)
 {
     if ((CurrentState == KeypadState.Disabled) && (ResizeParent.Instance.CurrentTier == ThisTier))
     {
         // Indicate we're ready
         CurrentState = KeypadState.Ready;
     }
 }
 public override Gazer.SoundEffectType OnInteract(Gazer gazer)
 {
     if (CurrentState == KeypadState.Ready)
     {
         // Indicate we allow typing
         CurrentState = KeypadState.Enabled;
         enterCodeSound.Play();
     }
     return(Gazer.SoundEffectType.None);
 }
Пример #6
0
        public void TestStop()
        {
            // TODO: Add your test code here
            Gazer gazer = new Gazer();

            gazer.Start();
            Tuple <double, double> coods = gazer.Stop();

            Assert.IsNotNull(coods);
        }
Пример #7
0
        public override Gazer.SoundEffectType OnInteract(Gazer gazer)
        {
            if (interactive == true)
            {
                // Toggle state
                LeverGroup.IsOn = !LeverGroup.IsOn;

                // Run gaze exit
                OnGazeExit(gazer);
            }
            return(Gazer.SoundEffectType.None);
        }
Пример #8
0
        /// <summary>
        /// Invoked when a gazer is deactivated
        /// </summary>
        /// <param name="gazer">Gazer.</param>
        private void EndGazer(Gazer gazer)
        {
            bool gazedAtBefore = this.IsGazedAt;

            this.activeGazers.Remove(gazer);
            bool gazedAtNow = this.IsGazedAt;

            if (gazedAtBefore && !gazedAtNow)
            {
                this.NotifyChange(gazedAtNow);
            }
        }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        //gazer
        gazer   = GameObject.Find("Main Camera").GetComponent <Gazer>();
        reticle = GameObject.Find("GvrReticlePointer").GetComponent <MeshRenderer>();

        if (GameObject.Find("InteractiveCanvas") == null)
        {
            Debug.LogError("Make interactive canvas active, or check its checkbox!!!!!");
        }
        interactiveCanvas = GameObject.Find("InteractiveCanvas").gameObject;
        disableInteractiveCanvas();
    }
Пример #10
0
        /// <summary>
        /// Invoked when a Gazer is activated
        /// </summary>
        /// <param name="gazer">Gazer.</param>
        private void StartGazer(Gazer gazer)
        {
            if (this.activeGazers.Contains(gazer))
            {
                return;
            }
            bool gazedAtBefore = this.IsGazedAt;

            this.activeGazers.Add(gazer);
            if (!gazedAtBefore)
            {
                this.NotifyChange(true);
            }
        }
Пример #11
0
 public override void OnGazeEnter(Gazer gazer)
 {
     interactive = true;
     if (labelsAnimation != null)
     {
         if (LeverGroup.IsOn == false)
         {
             labelsAnimation.SetInteger(LabelField, (int)LabelState.SwitchOn);
         }
         else
         {
             labelsAnimation.SetInteger(LabelField, (int)LabelState.SwitchOff);
         }
     }
 }
 public override Gazer.SoundEffectType OnInteract(Gazer gazer)
 {
     Gazer.SoundEffectType returnSound = Gazer.SoundEffectType.None;
     if (interactive == true)
     {
         if (HoldingItem != null)
         {
             TransferItem(this, gazer.PlayerHolder);
             OnGazeExit(gazer);
             returnSound = Gazer.SoundEffectType.PickUpKey;
         }
         else if (gazer.PlayerHolder.HoldingItem != null)
         {
             TransferItem(gazer.PlayerHolder, this);
             OnGazeExit(gazer);
             returnSound = Gazer.SoundEffectType.DropKey;
         }
     }
     return(returnSound);
 }
Пример #13
0
    public override Gazer.SoundEffectType OnInteract(Gazer gazer)
    {
        Gazer.SoundEffectType returnSound = Gazer.SoundEffectType.None;
        if (IsInteractive == true)
        {
            // Check if they're holding the correct item
            if (gazer.PlayerHolder.HoldingItem == associatedCode)
            {
                // Associate with the end of this key animation
                gazer.PlayerHolder.HoldingItem.OnAnimationEnd += HoldingItem_OnAnimationEnd;
                ItemHolder.TransferItem(gazer.PlayerHolder, keyHolder);

                // Play sound effect
                correctKeySound.Play();

                // Play drop sound
                returnSound = Gazer.SoundEffectType.DropKey;
            }
            else
            {
                // Display error
                errorLabel.gameObject.SetActive(true);
                if (firstTimeTryingKey == true)
                {
                    errorLabel.TranslationKey = FirstWrongKeyText;
                    firstTimeTryingKey        = false;
                }
                else
                {
                    errorLabel.TranslationKey = OtherWrongKeyText.RandomElement;
                }

                // Play sound effect
                wrongKeySound.Play();
            }
            IsInteractive = false;
        }
        return(returnSound);
    }
 public override void OnGazeEnter(Gazer gazer)
 {
     interactive = false;
     if ((HoldingItem != null) && (gazer.PlayerHolder.HoldingItem == null))
     {
         interactive = true;
         if (labelsAnimation != null)
         {
             labelsAnimation.SetInteger(StateField, (int)LabelState.PickUp);
         }
     }
     else if ((HoldingItem == null) && (gazer.PlayerHolder.HoldingItem != null))
     {
         interactive = true;
         if (labelsAnimation != null)
         {
             labelsAnimation.SetInteger(StateField, (int)LabelState.Drop);
         }
     }
     else if (labelsAnimation != null)
     {
         labelsAnimation.SetInteger(StateField, (int)LabelState.None);
     }
 }
Пример #15
0
 public override void OnGazeEnter(Gazer gazer)
 {
     isGazed = true;
     interactWith.OnGazeEnter(gazer);
 }
Пример #16
0
 public override void OnGazeExit(Gazer gazer)
 {
     isGazed = false;
     interactWith.OnGazeExit(gazer);
 }
Пример #17
0
        /// <summary>
        /// Provides a gazer instance which is not yet activated
        /// </summary>
        /// <returns>The gazer instance.</returns>
        public Gazer GetGazer()
        {
            var gazer = new Gazer(this, this.StartGazer, this.EndGazer);

            return(gazer);
        }
Пример #18
0
 public abstract Gazer.SoundEffectType OnInteract(Gazer gazer);
Пример #19
0
 public abstract void OnGazeExit(Gazer gazer);
Пример #20
0
 public abstract void OnGazeEnter(Gazer gazer);
Пример #21
0
 public override Gazer.SoundEffectType OnInteract(Gazer gazer)
 {
     return(interactWith.OnInteract(gazer));
 }
Пример #22
0
 public override void OnGazeExit(Gazer gazer)
 {
     errorLabel.gameObject.SetActive(false);
     IsInteractive = false;
 }
Пример #23
0
 public override void OnGazeExit(Gazer gazer)
 {
     // Do nothing
 }
Пример #24
0
 public override Gazer.SoundEffectType OnInteract(Gazer gazer)
 {
     return(Gazer.SoundEffectType.None);
 }
Пример #25
0
 public override void OnGazeEnter(Gazer gazer)
 {
     // Do nothing
 }