This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.IO.Compression; | |
public static class ByteArrayExtensions | |
{ | |
public static byte[] Compress(this byte[] raw) | |
{ | |
using (MemoryStream memory = new MemoryStream()) | |
{ | |
using (GZipStream gzip = new GZipStream(memory,CompressionMode.Compress, true)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
[RequireComponent(typeof(SteamVR_TrackedController))] | |
public class DashController : MonoBehaviour | |
{ | |
[SerializeField] | |
private float minDashRange = 0.5f; | |
[SerializeField] | |
private float maxDashRange = 40f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class ImageLoader : MonoBehaviour | |
{ | |
[SerializeField] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class GroundPlacementController : MonoBehaviour | |
{ | |
[SerializeField] | |
private GameObject placeableObjectPrefab; | |
[SerializeField] | |
private KeyCode newObjectHotkey = KeyCode.A; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class ChooseRandomColor : MonoBehaviour | |
{ | |
private void Start() | |
{ | |
GetComponent<Button>().onClick.AddListener(ChangeImageColor); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class ChooseRandomColor : MonoBehaviour | |
{ | |
public void ChangeImageColor() | |
{ | |
GetComponent<Image>().color = RandomColor(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class SpriteScroll : MonoBehaviour | |
{ | |
[SerializeField] | |
private float scrollSpeed = 1f; | |
private float rightEdge; | |
private float leftEdge; | |
private Vector3 distanceBetweenEdges; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class TriggerTester : MonoBehaviour | |
{ | |
private SteamVR_TrackedObject trackedObject; | |
[SerializeField] | |
private bool trigger; | |
[SerializeField] | |
private bool trackpad; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assign out any additional controllers only after both left and right have been assigned. | |
//if (leftIndex != OpenVR.k_unTrackedDeviceIndexInvalid && rightIndex != OpenVR.k_unTrackedDeviceIndexInvalid) | |
{ | |
for (uint deviceIndex = 0; deviceIndex < connected.Length; deviceIndex++) | |
{ | |
if (objectIndex >= objects.Length) | |
break; | |
if (!connected[deviceIndex]) | |
continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old Method | |
Debug.Log(string.Format("{0} handling puck held by changed - held by={1}", | |
character.gameObject.name, | |
puckHeldBy == null ? "" : puckHeldBy.gameObject.name)); |