Example #1
0
 // ---- GazeInput messages ----
 public void OnGazeEnter(GazeHit hit)
 {
     if (!enabled || isEntered)
     {
         return;
     }
     StartCoroutine("DoGazeEnterInternalCoroutine", hit);
 }
Example #2
0
 public void OnGazeStay(GazeHit hit)
 {
     if (!enabled || !isEntered)
     {
         return;
     }
     DoGazeStayInternal(hit);
 }
Example #3
0
 protected override void DoGazeExit(GazeHit hit)
 {
     iTween.ScaleTo(scaleObject, iTween.Hash(
                        "scale", startScale,
                        "speed", speed
                        )
                    );
 }
    protected override void DoGazeExit(GazeHit hit)
    {
        var currentValue = propertyMaterial.GetFloat(propertyName);
        var valueDelta   = currentValue - fromValue;

        D.Log("PropValueExit: from:{0} to:{1}", currentValue, (currentValue - valueDelta));
        propertyValueLerper.Lerp(currentValue, currentValue - valueDelta, SetPropertyValue, time);
    }
Example #5
0
 protected override void DoGazeExit( GazeHit hit )
 {
     iTween.ScaleTo( scaleObject, iTween.Hash(
                         "scale", startScale,
                         "speed", speed
                     )
                   );
 }
Example #6
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     if (!gazeAnimator.enabled)
     {
         gazeAnimator.enabled = true;
     }
     gazeAnimator.SetTrigger(GazeEnterTrigger);
 }
Example #7
0
 public void OnGazeExit(GazeHit hit)
 {
     if (!enabled || !isEntered)
     {
         return;
     }
     StopCoroutine("DoGazeEnterInternalCoroutine");
     DoGazeExitInternal(hit);
 }
Example #8
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     iTween.ScaleTo(scaleObject, iTween.Hash(
                        "name", "gazeScaleTo",
                        "scale", scale,
                        "speed", speed
                        )
                    );
 }
Example #9
0
    protected override void DoGazeStop(GazeHit hit)
    {
        iTween.StopByName(gameObject, "gazeExamine");

        if (boxCollider != null)
        {
            boxCollider.size = boxColliderStartSize;
        }
    }
Example #10
0
    public void OnGazeRightEnter( GazeHit hit )
    {
        int index = Array.IndexOf( slots, currentSlot );
        currentSlot = slots[++index % slots.Length];

        var p = turnTweenParams.ToHash();
        p["amount"] = new Vector3( 0, 0.25f, 0 );
        iTween.RotateBy( tray, p );
    }
Example #11
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     iTween.ScaleTo( scaleObject, iTween.Hash(
                         "name", "gazeScaleTo",
                         "scale", scale,
                         "speed", speed
                     )
                   );
 }
Example #12
0
 protected virtual void DoGazeStopInternal(GazeHit hit)
 {
     if (debug)
     {
         D.Log("DoGazeStop({0})", hit);
     }
     DoGazeStop(hit);
     isEntered = false;
 }
Example #13
0
 protected override void DoGazeExit(GazeHit hit)
 {
     iTween.Stop("rotate");
     iTween.RotateTo(gameObject, iTween.Hash(
                         "rotation", startRotation.eulerAngles,
                         "speed", speed,
                         "space", Space.Self,
                         "islocal", true
                         ));
 }
Example #14
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     iTween.ShakeRotation(shakeObject, iTween.Hash(
                              "name", "gazeShakeRotation",
                              "amount", amount,
                              "speed", speed,
                              "loopType", loopType
                              )
                          );
 }
Example #15
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     iTween.ShakeRotation( shakeObject, iTween.Hash(
                         "name", "gazeShakeRotation",
                         "amount", amount,
                         "speed", speed,
                         "loopType", loopType
                     )
                   );
 }
Example #16
0
 protected override void DoGazeExit(GazeHit hit)
 {
     D.Log("Move {0} back to {1}", tweenName, startPosition);
     iTween.MoveTo(moveObject, iTween.Hash(
                       "name", tweenName,
                       "position", startPosition,
                       "speed", speed,
                       "space", space,
                       "islocal", true
                       ));
 }
Example #17
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     iTween.Stop("rotate");
     transform.localRotation = startRotation;
     iTween.RotateTo(gameObject, iTween.Hash(
                         "rotation", rotation,
                         "speed", speed,
                         "space", Space.Self,
                         "islocal", true
                         ));
 }
Example #18
0
    public void OnGazeLeftEnter( GazeHit hit )
    {
        int index = Array.IndexOf( slots, currentSlot );
        index--;
        if ( index < 0 ) { index = slots.Length - 1; }
        currentSlot = slots[index];

        var p = turnTweenParams.ToHash();
        p["amount"] = new Vector3( 0, -0.25f, 0 );
        iTween.RotateBy( tray, p );
    }
Example #19
0
    private void DoGazeExit( GazeHit gazeHit )
    {
        if ( debug ) { D.Log( "GazeExit: {0}", CurrentGazeObject.name ); }
        CurrentGazeObject.SendMessage( GazeExitMessage, gazeHit, SendMessageOptions.DontRequireReceiver );

        BoxCollider bc = CurrentGazeHit.collider as BoxCollider;
        if ( bc ) {
            bc.size = originalBoundsSize;
        }

        CurrentGazeObject = null;
        CurrentGazeHit = DefaultRaycastHit;
    }
Example #20
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     D.Log("Move {0} to {1}", tweenName, position);
     //iTween.StopByName( tweenName );
     //if( space==Space.Self ) moveObject.transform.localPosition = startPosition;
     //else  moveObject.transform.position = startPosition;
     iTween.MoveTo(moveObject, iTween.Hash(
                       "name", tweenName,
                       "position", position,
                       "speed", speed
                       //"space", space,
                       //"islocal", space==Space.Self
                       ));
 }
Example #21
0
 // ---- Internal handling of GazeInputMessages ----
 protected virtual IEnumerator DoGazeEnterInternalCoroutine(GazeHit hit)
 {
     if (delay > 0)
     {
         yield return(new WaitForSeconds(delay));
     }
     if (debug)
     {
         D.Log("DoGazeEnter({0})", hit);
     }
     DoGazeEnter(hit);
     isEntered = true;
     yield return(null);
 }
Example #22
0
    protected override void DoGazeExit(GazeHit hit)
    {
        iTween.MoveTo(gameObject, iTween.Hash(
                          "position", startPos,
                          "speed", speed,
                          "space", Space.World
                          ));

        gazeInput = null;

        if (boxCollider != null)
        {
            boxCollider.size = boxColliderStartSize;
        }
    }
Example #23
0
    private void DoGazeEnter( GameObject newGazeObject, GazeHit gazeHit )
    {
        CurrentGazeObject = newGazeObject;
        CurrentGazeHit = gazeHit.hit;

        // Fudge: Make the collision area bigger to make it easier to keep the gaze.
        // There is probably a more graceful way of doing this.
        BoxCollider bc = CurrentGazeHit.collider as BoxCollider;
        if ( bc != null ) {
            originalBoundsSize = bc.size;
            bc.size = bc.size * 2;
        }

        // Enter the new gaze object
        if ( debug ) { D.Log( "GazeEnter: {0}", CurrentGazeObject.name ); }
        CurrentGazeObject.SendMessage( GazeEnterMessage, gazeHit, SendMessageOptions.DontRequireReceiver );
    }
Example #24
0
    protected override void DoGazeEnter(GazeHit hit)
    {
        gazeInput = hit.gazeInput;
        var pos = gazeInput.GazeTransform.forward * examineRadius;

        if (boxCollider != null)
        {
            boxCollider.size = boxColliderStartSize * 2;
        }

        iTween.MoveTo(gameObject, iTween.Hash(
                          "name", "gazeExamine",
                          "position", gazeInput.GazeTransform.position + pos + examineOffset,
                          "speed", speed,
                          "space", Space.World
                          ));
    }
Example #25
0
    private void DoGazeExit(GazeHit gazeHit)
    {
        if (debug)
        {
            D.Log("GazeExit: {0}", CurrentGazeObject.name);
        }
        CurrentGazeObject.SendMessage(GazeExitMessage, gazeHit, SendMessageOptions.DontRequireReceiver);

        BoxCollider bc = CurrentGazeHit.collider as BoxCollider;

        if (bc)
        {
            bc.size = originalBoundsSize;
        }

        CurrentGazeObject = null;
        CurrentGazeHit    = DefaultRaycastHit;
    }
Example #26
0
    private void DoGazeEnter(GameObject newGazeObject, GazeHit gazeHit)
    {
        CurrentGazeObject = newGazeObject;
        CurrentGazeHit    = gazeHit.hit;

        // Fudge: Make the collision area bigger to make it easier to keep the gaze.
        // There is probably a more graceful way of doing this.
        BoxCollider bc = CurrentGazeHit.collider as BoxCollider;

        if (bc != null)
        {
            originalBoundsSize = bc.size;
            bc.size            = bc.size * 2;
        }

        // Enter the new gaze object
        if (debug)
        {
            D.Log("GazeEnter: {0}", CurrentGazeObject.name);
        }
        CurrentGazeObject.SendMessage(GazeEnterMessage, gazeHit, SendMessageOptions.DontRequireReceiver);
    }
Example #27
0
    protected virtual void DoGazeExitInternal(GazeHit hit)
    {
        if (debug)
        {
            D.Log("DoGazeExit({0})", hit);
        }

        // Decide how to handle the gaze exit.
        if (exitBehaviour == UndoBehaviour.Stop)
        {
            DoGazeStop(hit);
        }
        if (exitBehaviour == UndoBehaviour.Undo)
        {
            DoGazeExit(hit);
        }

        // If there is no exit behaviour we stay "on"
        if (exitBehaviour != UndoBehaviour.Nothing)
        {
            isEntered = false;
        }
    }
Example #28
0
 protected override void DoGazeStop( GazeHit hit )
 {
     iTween.Stop( "gazeShakeRotation" );
 }
Example #29
0
 protected override void DoGazeStop( GazeHit hit )
 {
     audio.Stop();
 }
Example #30
0
 public void OnGazeExit( GazeHit hit )
 {
     D.Log( "Forward OnGazeExit to {0}.", messageReceiver.name );
     messageReceiver.SendMessage( GazeExitMessage, hit, SendMessageOptions.DontRequireReceiver );
 }
 protected override void DoGazeStop(GazeHit hit)
 {
     D.Log("PropvalueStop");
     propertyValueLerper.Stop();
 }
Example #32
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     audio.clip = gazeAudio;
     audio.Play();
 }
 protected override void DoGazeEnter(GazeHit hit)
 {
     fromValue = propertyMaterial.GetFloat(propertyName);
     D.Log("PropValueEnter: from:{0} to:{1}", fromValue, toValue);
     propertyValueLerper.Lerp(fromValue, toValue, SetPropertyValue, time);
 }
Example #34
0
 private void DoGazeStay( GazeHit gazeHit )
 {
     CurrentGazeObject.SendMessage( GazeStayMessage, gazeHit, SendMessageOptions.DontRequireReceiver );
     //if ( debug ) { D.Log( "GazeStay: {0}", CurrentGazeObject.name ); }
 }
Example #35
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     startParams = LightParams.ToParams( gazeLight );
     lightLerper.Lerp( startParams, lightToParams, lp=>lp.Apply(gazeLight), time );
 }
Example #36
0
 protected override void DoGazeStop( GazeHit hit )
 {
     colorLerper.Stop();
 }
Example #37
0
 protected override void DoGazeStop(GazeHit hit)
 {
     audio.Stop();
 }
Example #38
0
    protected override void DoGazeExit(GazeHit hit)
    {
        var colorDiff = RenderSettings.ambientLight - fromColor;

        colorLerper.Lerp(RenderSettings.ambientLight, fromColor - colorDiff, v => RenderSettings.ambientLight = v, time);
    }
Example #39
0
 protected override void DoGazeStop( GazeHit hit )
 {
     gazeAnimator.ResetTrigger( GazeEnterTrigger );
     gazeAnimator.ResetTrigger( GazeExitTrigger );
     gazeAnimator.Play( startStateHash );
 }
Example #40
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     if( !gazeAnimator.enabled ) gazeAnimator.enabled = true;
     gazeAnimator.SetTrigger( GazeEnterTrigger );
 }
Example #41
0
 protected override void DoGazeExit( GazeHit hit )
 {
     var currLightParams = LightParams.ToParams( gazeLight );
     lightLerper.Lerp( currLightParams, startParams, lp=>lp.Apply(gazeLight), time );
 }
Example #42
0
 protected override void DoGazeStop( GazeHit hit )
 {
     lightLerper.Stop();
 }
Example #43
0
 void OnGazeStay( GazeHit hit )
 {
     painter.positionsUV.Add( hit.hit.textureCoord );
 }
Example #44
0
 protected override void DoGazeExit( GazeHit hit )
 {
     gazeAnimator.SetTrigger( GazeExitTrigger );
 }
Example #45
0
 protected override void DoGazeStop( GazeHit hit )
 {
     iTween.StopByName( "gazeScaleTo" );
 }
Example #46
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     audio.clip = gazeAudio;
     audio.Play();
 }
Example #47
0
 protected override void DoGazeStop(GazeHit hit)
 {
     StopParticleSystems(particleSystems);
 }
Example #48
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     fromColor = RenderSettings.ambientLight;
     colorLerper.Lerp(fromColor, ambientColorTo, v => RenderSettings.ambientLight = v, time);
 }
Example #49
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     fromColor = RenderSettings.ambientLight;
     colorLerper.Lerp( fromColor, fromColor + ambientColorBy, v=>RenderSettings.ambientLight=v, time );
 }
Example #50
0
 protected override void DoGazeStop(GazeHit hit)
 {
     colorLerper.Stop();
 }
Example #51
0
 protected override void DoGazeExit( GazeHit hit )
 {
     var colorDiff = RenderSettings.ambientLight - fromColor;
     colorLerper.Lerp( RenderSettings.ambientLight, fromColor - colorDiff, v=>RenderSettings.ambientLight=v, time );
 }