public override void OnCardboardTrigger() { Log.Info(Tag, "onCardboardTrigger"); // Always give user feedback vibrator.Vibrate(50); // Display toast if (game.IsLookingAtObject) { var message = string.Format("thing has been found {0} times", ++this.findCounter); overlayView = FindViewById <CardboardOverlayView> (Resource.Id.overlay); overlayView.Show3DToast(message); } }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView (Resource.Layout.common_ui); CardboardView cardboardView = FindViewById<CardboardView> (Resource.Id.cardboard_view); cardboardView.SetRenderer (this); CardboardView = cardboardView; vibrator = (Vibrator)GetSystemService (Context.VibratorService); overlayView = FindViewById<CardboardOverlayView> (Resource.Id.overlay); overlayView.Show3DToast ("Pull the magnet\nwhen you find an object."); headView = new float[16]; game = new Game (this, headView); VolumeKeysMode = VolumeKeys.DisabledWhileInCardboard; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.common_ui); CardboardView cardboardView = FindViewById <CardboardView> (Resource.Id.cardboard_view); cardboardView.SetRenderer(this); CardboardView = cardboardView; vibrator = (Vibrator)GetSystemService(Context.VibratorService); overlayView = FindViewById <CardboardOverlayView> (Resource.Id.overlay); overlayView.Show3DToast("Pull the magnet\nwhen you find an object."); headView = new float[16]; game = new Game(this, headView); VolumeKeysMode = VolumeKeys.DisabledWhileInCardboard; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.common_ui); CardboardView cardboardView = FindViewById <CardboardView> (Resource.Id.cardboard_view); cardboardView.SetRenderer(this); CardboardView = cardboardView; modelCube = new float[16]; camera = new float[16]; view = new float[16]; modelViewProjection = new float[16]; modelView = new float[16]; modelFloor = new float[16]; headView = new float[16]; mVibrator = (Vibrator)GetSystemService(Context.VibratorService); mOverlayView = FindViewById <CardboardOverlayView> (Resource.Id.overlay); mOverlayView.show3DToast("Pull the magnet when you find an object."); }
public void OnFinishFrame(Viewport viewport) { game.FinishFrame(); // update color var proximity = game.DistanceRatioFromObject; var newColor = Color.Rgb(0, 0, 0); if (proximity < 0.1) { newColor = Color.Green; } else if (proximity < 0.3) { newColor = Color.Yellow; } else { newColor = Color.Red; } overlayView = FindViewById <CardboardOverlayView> (Resource.Id.overlay); overlayView.SetTemperatureColor(newColor); }