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 System; | |
using UnityEngine; | |
using System.Collections; | |
[Serializable] | |
public class AnimParam | |
{ | |
private readonly int _hashed;//a cached off version of the hashed string | |
private readonly string _paramName;//don't really need but good for debug? | |
private readonly Animator _anim; |
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 System; | |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine.EventSystems; | |
//I used ILSpy on the Unity UI dll to copy out the Physicsraycaster code and fix where the ray eminates from (in this case, always the center of the screen) | |
public class InteractionRaycaster : PhysicsRaycaster { | |
[Range(0.0f, 0.5f)] |
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
class MyControllerComponent : MonoBehaviour{ | |
Animator _anim; | |
AnimParam _myTrigger; | |
void Awake() | |
{ | |
_anim = GetComponent<Animator>(); | |
_playbackDurations = GetComponent<PlaybackDurationManager>(); | |
_myTrigger = _anim.AnimParam("StartThings"); | |
} |
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
Shader "Unlit/VertexAlphaPlusColour" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_Color("Color", Color) = (1,1,1,1) | |
} | |
SubShader | |
{ | |
Tags { "Queue"="Transparent" "RenderType"="Opaque" } |
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 System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
public static class PrefabLoader | |
{ | |
//So, there's no "load all assets in directory" function in unity. | |
//I guess this is to avoid people using Prefabs as "data blobs". | |
//They'd rather you use ScriptableObjects... which is fine in some cases, |
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
public class OneOneOneTwoThree | |
{ | |
bool[] Null(bool[] t) | |
{ | |
return t;// lol | |
} | |
bool[] Swap(bool[] t) | |
{ | |
bool[] s = new bool[4]; |
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; | |
public static class Vector3Extensions { | |
public static Vector3 Flattened(this Vector3 vec, Vector3 planeNormal) | |
{ | |
return Vector3.ProjectOnPlane(vec, planeNormal); | |
} |
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; | |
using System.Collections.Generic; | |
public static class BoundsHelperExtensions | |
{ | |
public static Bounds WorldBounds<T>(this List<T> listOfThings) where T : MonoBehaviour | |
{ | |
Bounds bounds = new Bounds(listOfThings[0].transform.position, Vector3.zero); | |
foreach (T thing in listOfThings) |
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.Collections; | |
using System.Collections.Generic; | |
[CustomPropertyDrawer(typeof(IntRangeAttribute))] | |
public class IntRangeDrawer : PropertyDrawer | |
{ | |
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | |
{ |
NewerOlder