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); } }
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); }
public void TestStop() { // TODO: Add your test code here Gazer gazer = new Gazer(); gazer.Start(); Tuple <double, double> coods = gazer.Stop(); Assert.IsNotNull(coods); }
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); }
/// <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); } }
// 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(); }
/// <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); } }
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); }
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); } }
public override void OnGazeEnter(Gazer gazer) { isGazed = true; interactWith.OnGazeEnter(gazer); }
public override void OnGazeExit(Gazer gazer) { isGazed = false; interactWith.OnGazeExit(gazer); }
/// <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); }
public abstract Gazer.SoundEffectType OnInteract(Gazer gazer);
public abstract void OnGazeExit(Gazer gazer);
public abstract void OnGazeEnter(Gazer gazer);
public override Gazer.SoundEffectType OnInteract(Gazer gazer) { return(interactWith.OnInteract(gazer)); }
public override void OnGazeExit(Gazer gazer) { errorLabel.gameObject.SetActive(false); IsInteractive = false; }
public override void OnGazeExit(Gazer gazer) { // Do nothing }
public override Gazer.SoundEffectType OnInteract(Gazer gazer) { return(Gazer.SoundEffectType.None); }
public override void OnGazeEnter(Gazer gazer) { // Do nothing }