// ---- GazeInput messages ---- public void OnGazeEnter(GazeHit hit) { if (!enabled || isEntered) { return; } StartCoroutine("DoGazeEnterInternalCoroutine", hit); }
public void OnGazeStay(GazeHit hit) { if (!enabled || !isEntered) { return; } DoGazeStayInternal(hit); }
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); }
protected override void DoGazeExit( GazeHit hit ) { iTween.ScaleTo( scaleObject, iTween.Hash( "scale", startScale, "speed", speed ) ); }
protected override void DoGazeEnter(GazeHit hit) { if (!gazeAnimator.enabled) { gazeAnimator.enabled = true; } gazeAnimator.SetTrigger(GazeEnterTrigger); }
public void OnGazeExit(GazeHit hit) { if (!enabled || !isEntered) { return; } StopCoroutine("DoGazeEnterInternalCoroutine"); DoGazeExitInternal(hit); }
protected override void DoGazeEnter(GazeHit hit) { iTween.ScaleTo(scaleObject, iTween.Hash( "name", "gazeScaleTo", "scale", scale, "speed", speed ) ); }
protected override void DoGazeStop(GazeHit hit) { iTween.StopByName(gameObject, "gazeExamine"); if (boxCollider != null) { boxCollider.size = boxColliderStartSize; } }
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 ); }
protected override void DoGazeEnter( GazeHit hit ) { iTween.ScaleTo( scaleObject, iTween.Hash( "name", "gazeScaleTo", "scale", scale, "speed", speed ) ); }
protected virtual void DoGazeStopInternal(GazeHit hit) { if (debug) { D.Log("DoGazeStop({0})", hit); } DoGazeStop(hit); isEntered = false; }
protected override void DoGazeExit(GazeHit hit) { iTween.Stop("rotate"); iTween.RotateTo(gameObject, iTween.Hash( "rotation", startRotation.eulerAngles, "speed", speed, "space", Space.Self, "islocal", true )); }
protected override void DoGazeEnter(GazeHit hit) { iTween.ShakeRotation(shakeObject, iTween.Hash( "name", "gazeShakeRotation", "amount", amount, "speed", speed, "loopType", loopType ) ); }
protected override void DoGazeEnter( GazeHit hit ) { iTween.ShakeRotation( shakeObject, iTween.Hash( "name", "gazeShakeRotation", "amount", amount, "speed", speed, "loopType", loopType ) ); }
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 )); }
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 )); }
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 ); }
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; }
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 )); }
// ---- 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); }
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; } }
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 ); }
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 )); }
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; }
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); }
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; } }
protected override void DoGazeStop( GazeHit hit ) { iTween.Stop( "gazeShakeRotation" ); }
protected override void DoGazeStop( GazeHit hit ) { audio.Stop(); }
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(); }
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); }
private void DoGazeStay( GazeHit gazeHit ) { CurrentGazeObject.SendMessage( GazeStayMessage, gazeHit, SendMessageOptions.DontRequireReceiver ); //if ( debug ) { D.Log( "GazeStay: {0}", CurrentGazeObject.name ); } }
protected override void DoGazeEnter( GazeHit hit ) { startParams = LightParams.ToParams( gazeLight ); lightLerper.Lerp( startParams, lightToParams, lp=>lp.Apply(gazeLight), time ); }
protected override void DoGazeStop( GazeHit hit ) { colorLerper.Stop(); }
protected override void DoGazeStop(GazeHit hit) { audio.Stop(); }
protected override void DoGazeExit(GazeHit hit) { var colorDiff = RenderSettings.ambientLight - fromColor; colorLerper.Lerp(RenderSettings.ambientLight, fromColor - colorDiff, v => RenderSettings.ambientLight = v, time); }
protected override void DoGazeStop( GazeHit hit ) { gazeAnimator.ResetTrigger( GazeEnterTrigger ); gazeAnimator.ResetTrigger( GazeExitTrigger ); gazeAnimator.Play( startStateHash ); }
protected override void DoGazeEnter( GazeHit hit ) { if( !gazeAnimator.enabled ) gazeAnimator.enabled = true; gazeAnimator.SetTrigger( GazeEnterTrigger ); }
protected override void DoGazeExit( GazeHit hit ) { var currLightParams = LightParams.ToParams( gazeLight ); lightLerper.Lerp( currLightParams, startParams, lp=>lp.Apply(gazeLight), time ); }
protected override void DoGazeStop( GazeHit hit ) { lightLerper.Stop(); }
void OnGazeStay( GazeHit hit ) { painter.positionsUV.Add( hit.hit.textureCoord ); }
protected override void DoGazeExit( GazeHit hit ) { gazeAnimator.SetTrigger( GazeExitTrigger ); }
protected override void DoGazeStop( GazeHit hit ) { iTween.StopByName( "gazeScaleTo" ); }
protected override void DoGazeEnter(GazeHit hit) { audio.clip = gazeAudio; audio.Play(); }
protected override void DoGazeStop(GazeHit hit) { StopParticleSystems(particleSystems); }
protected override void DoGazeEnter(GazeHit hit) { fromColor = RenderSettings.ambientLight; colorLerper.Lerp(fromColor, ambientColorTo, v => RenderSettings.ambientLight = v, time); }
protected override void DoGazeEnter( GazeHit hit ) { fromColor = RenderSettings.ambientLight; colorLerper.Lerp( fromColor, fromColor + ambientColorBy, v=>RenderSettings.ambientLight=v, time ); }
protected override void DoGazeStop(GazeHit hit) { colorLerper.Stop(); }
protected override void DoGazeExit( GazeHit hit ) { var colorDiff = RenderSettings.ambientLight - fromColor; colorLerper.Lerp( RenderSettings.ambientLight, fromColor - colorDiff, v=>RenderSettings.ambientLight=v, time ); }