Skip to content

Instantly share code, notes, and snippets.

View julenka's full-sized avatar

Julia Schwarz julenka

View GitHub Profile
@julenka
julenka / CSVLogger.cs
Last active August 11, 2023 05:50
Log data to CSV on HoloLens from a Unity project. Writes to Pictures folder instead of applicationDataPath so that files can be accessed from File Explorer (File Explorer -> HoloLens -> Pictures -> YourFolder). Doesn't require using Device portal.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
#if WINDOWS_UWP
using Windows.Storage;
#endif
@julenka
julenka / FlyCamera.cs
Last active March 29, 2020 23:29 — forked from RyanBreaker/FlyCamera.cs
Unity Script to give camera WASD + mouse control when right mouse clicked
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour
{
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Reformatted and cleaned by Ryan Breaker 23-6-18
Added Q/E keys to move up/down and only move mouse when right button clicked by Julia Schwarz 29-3-20
@julenka
julenka / FlyCamera.cs
Created March 29, 2020 23:05 — forked from gunderson/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@julenka
julenka / .gitignore
Last active May 13, 2020 22:51
MRTK gitignore for MRTK 2.3
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
@julenka
julenka / EyeGaze.cs
Created February 3, 2020 23:12
Get Eye Gaze from HoloLens, thanks to @maluoi
using UnityEngine;
#if WINDOWS_UWP
using System;
using System.Runtime.InteropServices;
using UnityEngine.XR.WSA;
using Windows.UI.Input;
using Windows.UI.Input.Spatial;
using Windows.Perception;
using Windows.Perception.Spatial;
@julenka
julenka / IsAnyHandPressed.cs
Last active January 8, 2020 21:25
Check if any hand is pinching or pressed in MRTK
// Approach using LINQ
private bool IsAnyHandPressed()
{
return CoreServices.InputSystem.DetectedControllers
.OfType<IMixedRealityHand>()
.Any(h => h.Interactions.Any(i => i.InputType == DeviceInputType.Select && i.BoolData));
}
// Approach using for loops
private bool IsAnyHandPressed()
@julenka
julenka / IsAnyHandPressed
Created January 8, 2020 20:45
Check if any hand is pinching or pressed in MRTK
private bool IsAnyHandPressed()
{
foreach (var controller in CoreServices.InputSystem.DetectedControllers)
{
if (controller is IMixedRealityHand)
{
for (int i = 0; i < controller.Interactions.Length; i++)
{
if(controller.Interactions[i].InputType == DeviceInputType.Select)
{
@julenka
julenka / ManipulationHandler.cs
Created November 7, 2019 16:37
ManipulationHandler OnClick Events
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Physics;
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@julenka
julenka / Interactable.cs
Created November 4, 2019 21:03
Interactable Event Receivever Fix
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Utilities;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Physics;
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;