Skip to content

Instantly share code, notes, and snippets.

Andy Moore SnugglePilot

Block or report user

Report or block SnugglePilot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SwitchSDK.cs
private IEnumerator SwitchSDK(string sdkName)
{
if (UnityEngine.XR.XRSettings.loadedDeviceName == sdkName)
{
// Debug.Log("VR SDK already loaded ("+sdkName+")");
}
else
{
Debug.LogFormat("Switching VR SDK to {0}", sdkName);
UnityEngine.XR.XRSettings.LoadDeviceByName(sdkName);
@SnugglePilot
SnugglePilot / LUX Web Engine - index.php
Last active Jul 2, 2018
the LUX Web Engine: a simple not-a-blog thing
View LUX Web Engine - index.php
<?php
// LUX Web Engine - created bespoke for SnugglePilot.com.
// Created by Andy Moore. Run this code at your own risk. "Whatever" license I guess.
// Changelog/instructions: http://snugglepilot.com/?p=lux%20web%20engine
// v8 - Updated July 2nd, 2018
// ##############
// Configuration:
@SnugglePilot
SnugglePilot / NetworkDebugUI.cs
Created Feb 17, 2017
NetworkDebugUI for Photon/Unity
View NetworkDebugUI.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NetworkDebugUI : MonoBehaviour {
public UnityEngine.Events.UnityEvent onOnline;
public UnityEngine.Events.UnityEvent onOffline;
protected bool isOnline = false;
protected bool showMic = false;
View SmoothDampTransform.cs
using UnityEngine;
using System.Collections;
public class SmoothDampTransform : MonoBehaviour {
public bool trackPosition = true;
public bool trackRotation = true;
public float translateTime;
public float rotateTime;
public Vector3 targetPosition { get; private set; }
View gist:ce094bc54ee15c3801e704d4edf22a3e
How to setup an RSS feed for Steam Reviews by @Capn_Andy
(Thanks to @Chaklapak for pointing me this way.)
Step One: Get your link
Get the URL for your game's Steam Reviews, sorted by "most recent." Eg:
http://steamcommunity.com/app/386690/reviews/?p=1&browsefilter=mostrecent
Step Two: Setup the input
View gist:fd6db950e3a30cd04d89a6dea6b79bce
rotTrackingTimeLeft -= Time.deltaTime;
Vector3 eulerAngles = this.transform.rotation.eulerAngles;
eulerAngles.x = Mathf.SmoothDampAngle(eulerAngles.x, targetRotation.eulerAngles.x, ref rotVel.x, rotateTime, Mathf.Infinity, Time.deltaTime);
eulerAngles.y = Mathf.SmoothDampAngle(eulerAngles.y, targetRotation.eulerAngles.y, ref rotVel.y, rotateTime, Mathf.Infinity, Time.deltaTime);
eulerAngles.z = Mathf.SmoothDampAngle(eulerAngles.z, targetRotation.eulerAngles.z, ref rotVel.z, rotateTime, Mathf.Infinity, Time.deltaTime);
if (float.IsNaN(eulerAngles.x) || float.IsNaN (eulerAngles.y) || float.IsNaN (eulerAngles.z)) {
// Woops. I don't know why this is the case. TODO: Find out why and fix later.
//Debug.Log ("1:"+this.transform.rotation.eulerAngles);
//Debug.Log ("2:"+targetRotation.eulerAngles);
// ^^ Always the same?!
View SubmitFormOnline.cs
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
public class SubmitFormOnline : MonoBehaviour {
public InputField textReference;
public string pendingDir;
// FormID comes from the google drive ID, eg:
View SaveFormToDisk.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.IO;
public class SaveFormToDisk : MonoBehaviour {
public InputField textReference;
public string saveDir;
public void SaveToFile(string text, string subDir) {
View LinkedCamera.cs
using UnityEngine;
using System.Collections;
public class LinkedCamera : MonoBehaviour {
// What transform to chase:
public Transform target;
// Debug keyboard controls:
public KeyCode modifier;
public KeyCode incSmooth;
View CompanionCamera.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CompanionCamera : MonoBehaviour {
// Debug shortcut keys:
public KeyCode modifier;
public KeyCode toggleButton;
// If true, this will permanently disable the SteamVR companion camera.
You can’t perform that action at this time.