Skip to content

Instantly share code, notes, and snippets.

View StephenHodgson's full-sized avatar
👾
Raging against pixels

Stephen Hodgson StephenHodgson

👾
Raging against pixels
View GitHub Profile
@StephenHodgson
StephenHodgson / CustomAssetInspector.cs
Last active February 27, 2023 19:54
Unity custom inspector window to render markdown language as text asset.
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(DefaultAsset))]
public class CustomAssetInspector : Editor
{
public override void OnInspectorGUI()
{
@StephenHodgson
StephenHodgson / DownloadHelper.cs
Last active June 7, 2019 19:16
Unity Image Downloader example
using System;
using System.Collections;
using System.Text;
using UnityEngine;
using UnityEngine.Networking;
public class DownloadHelper : MonoBehaviour
{
private string userName = string.Empty;
private string password = string.Empty;
@StephenHodgson
StephenHodgson / NewBehaviourScript.cs
Created October 16, 2018 04:13
Default Unity Template
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
@StephenHodgson
StephenHodgson / InputDemo.cs
Last active March 11, 2019 19:05
Example script for Getting to know the new XRTK
public class InputTest : BaseInputHandler, IMixedRealitySpatialInputHandler
{
[SerializeField]
private MixedRealityInputAction myAction = MixedRealityInputAction.None; // <-- Set in the inspector.
public void OnInputUp(InputEventData eventData)
{
if (eventData.MixedRealityInputAction == myAction)
{
Debug.Log($"OnInputUp {eventData.InputSource.SourceName} | {eventData.MixedRealityInputAction.Description}");
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using XRTK.Interfaces;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
/// <summary>
/// The custom interface for your extension service.
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using UnityEngine;
using XRTK.Extensions;
using XRTK.Services;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using XRTK.Definitions;
using UnityEngine;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
/// <summary>
/// This is the custom configuration profile for your custom extension service.
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEditor;
using XRTK.Editor.Profiles;
using XRTK.Examples.Demos.CustomExtensionServices;
namespace XRTK
{
/// <summary>
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@StephenHodgson
StephenHodgson / Program.cs
Last active May 27, 2021 21:33
Test recording microphone data using LibVLCSharp
using System;
using System.IO;
using LibVLCSharp.Shared;
namespace test_microphone_recording
{
internal class Program
{
private static MemoryStream stream;
private static LibVLC vlc;