This file contains 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 Hover : MonoBehaviour | |
{ | |
public float maxDistance, maxForce; | |
private Vector3 forceVector; | |
This file contains 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
// GravityObject.cs | |
using UnityEngine; | |
using System.Collections; | |
[RequireComponent (typeof (Rigidbody))] | |
public class GravityObject : MonoBehaviour | |
{ | |
public float gravityModifier = 1.0f; | |
This file contains 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 System.Collections; | |
[RequireComponent (typeof (BoxCollider))] | |
public class ContainerGravity : MonoBehaviour | |
{ | |
public float strength = 10.0f; | |
This file contains 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
target.RotateAround (target.position, target.right, addedRotation); | |
bool lookingUp = Vector3.Angle (target.forward, Vector3.up) < Vector3.Angle (target.forward, Vector3.up * -1.0f); | |
float angle = Vector3.Angle (target.forward, Vector3.Cross (target.right, Vector3.up)); | |
if (angle > forwardAngleClamp) | |
{ | |
target.RotateAround (target.position, target.right, lookingUp ? angle - forwardAngleClamp : forwardAngleClamp - angle); | |
} |
This file contains 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 System.Reflection; | |
public class Utilities | |
{ | |
/* ... */ | |
static void LogGameObject( GameObject gameObject, bool children ) | |
{ | |
Component[] components = gameObject.GetComponents( typeof( Component ) ); |
This file contains 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 UnityEditor; | |
using System.IO; | |
public class MultiScene | |
{ | |
[MenuItem ("File/Combine Scenes")] | |
static void Combine () | |
{ |
This file contains 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
//#define DEBUG_THREADING | |
using UnityEngine; | |
using System.Collections; | |
using System.Threading; | |
using System.Reflection; | |
public delegate IEnumerator MonitorCoroutine<T> (CoroutineData<T> data); |
This file contains 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 System.Collections; | |
/* | |
Runtime use: | |
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or | |
via the global AirPlay mirroring setting. Your options are: | |
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content. |
This file contains 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
#!/usr/bin/env bash | |
set -euo pipefail | |
serviceName="home-assistant.service" | |
startTime=$(systemctl show -p ActiveEnterTimestamp "$serviceName") | |
startTime=$(echo $startTime | awk '{print $2 $3}') | |
echo "Missing modules reported since $serviceName start at $startTime:" |
This file contains 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 System.Reflection; | |
public class TerriblyHackyLog : MonoBehaviour | |
{ | |
void Start () | |
{ | |
Log ("Aaaaarrrrgh!"); | |
} |
NewerOlder