예제 #1
0
 // ---- GazeInput messages ----
 public void OnGazeEnter(GazeHit hit)
 {
     if (!enabled || isEntered)
     {
         return;
     }
     StartCoroutine("DoGazeEnterInternalCoroutine", hit);
 }
예제 #2
0
 public void OnGazeStay(GazeHit hit)
 {
     if (!enabled || !isEntered)
     {
         return;
     }
     DoGazeStayInternal(hit);
 }
예제 #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);
    }
예제 #5
0
 protected override void DoGazeExit( GazeHit hit )
 {
     iTween.ScaleTo( scaleObject, iTween.Hash(
                         "scale", startScale,
                         "speed", speed
                     )
                   );
 }
예제 #6
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     if (!gazeAnimator.enabled)
     {
         gazeAnimator.enabled = true;
     }
     gazeAnimator.SetTrigger(GazeEnterTrigger);
 }
예제 #7
0
 public void OnGazeExit(GazeHit hit)
 {
     if (!enabled || !isEntered)
     {
         return;
     }
     StopCoroutine("DoGazeEnterInternalCoroutine");
     DoGazeExitInternal(hit);
 }
예제 #8
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     iTween.ScaleTo(scaleObject, iTween.Hash(
                        "name", "gazeScaleTo",
                        "scale", scale,
                        "speed", speed
                        )
                    );
 }
예제 #9
0
    protected override void DoGazeStop(GazeHit hit)
    {
        iTween.StopByName(gameObject, "gazeExamine");

        if (boxCollider != null)
        {
            boxCollider.size = boxColliderStartSize;
        }
    }
예제 #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 );
    }
예제 #11
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     iTween.ScaleTo( scaleObject, iTween.Hash(
                         "name", "gazeScaleTo",
                         "scale", scale,
                         "speed", speed
                     )
                   );
 }
예제 #12
0
 protected virtual void DoGazeStopInternal(GazeHit hit)
 {
     if (debug)
     {
         D.Log("DoGazeStop({0})", hit);
     }
     DoGazeStop(hit);
     isEntered = false;
 }
예제 #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
                         ));
 }
예제 #14
0
 protected override void DoGazeEnter(GazeHit hit)
 {
     iTween.ShakeRotation(shakeObject, iTween.Hash(
                              "name", "gazeShakeRotation",
                              "amount", amount,
                              "speed", speed,
                              "loopType", loopType
                              )
                          );
 }
예제 #15
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     iTween.ShakeRotation( shakeObject, iTween.Hash(
                         "name", "gazeShakeRotation",
                         "amount", amount,
                         "speed", speed,
                         "loopType", loopType
                     )
                   );
 }
예제 #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
                       ));
 }
예제 #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
                         ));
 }
예제 #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 );
    }
예제 #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;
    }
예제 #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
                       ));
 }
예제 #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);
 }
예제 #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;
        }
    }
예제 #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 );
    }
예제 #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
                          ));
    }
예제 #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;
    }
예제 #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);
    }
예제 #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;
        }
    }
예제 #28
0
 protected override void DoGazeStop( GazeHit hit )
 {
     iTween.Stop( "gazeShakeRotation" );
 }
예제 #29
0
 protected override void DoGazeStop( GazeHit hit )
 {
     audio.Stop();
 }
예제 #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();
 }
예제 #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);
 }
예제 #34
0
 private void DoGazeStay( GazeHit gazeHit )
 {
     CurrentGazeObject.SendMessage( GazeStayMessage, gazeHit, SendMessageOptions.DontRequireReceiver );
     //if ( debug ) { D.Log( "GazeStay: {0}", CurrentGazeObject.name ); }
 }
예제 #35
0
 protected override void DoGazeEnter( GazeHit hit )
 {
     startParams = LightParams.ToParams( gazeLight );
     lightLerper.Lerp( startParams, lightToParams, lp=>lp.Apply(gazeLight), time );
 }
예제 #36
0
 protected override void DoGazeStop( GazeHit hit )
 {
     colorLerper.Stop();
 }
예제 #37
0
 protected override void DoGazeStop(GazeHit hit)
 {
     audio.Stop();
 }
예제 #38
0
    protected override void DoGazeExit(GazeHit hit)
    {
        var colorDiff = RenderSettings.ambientLight - fromColor;

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