示例#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 );
 }