Skip to content

Instantly share code, notes, and snippets.

View MattRix's full-sized avatar

Matt Rix MattRix

View GitHub Profile
@MattRix
MattRix / UnityEditorIcons.txt
Last active April 26, 2026 06:04
A list of all the built-in EdtiorGUI icons in Unity. Use EditorGUIUtility.IconContent([icon name]) to access them.
ScriptableObject Icon
_Popup
_Help
Clipboard
SocialNetworks.UDNOpen
SocialNetworks.Tweet
SocialNetworks.FacebookShare
SocialNetworks.LinkedInShare
SocialNetworks.UDNLogo
animationvisibilitytoggleoff
@MattRix
MattRix / UnityDocumentationComments.md
Created April 23, 2016 16:06
Why I believe it is important to have comments on Unity Documentation pages

This post is a response to this forum posting by a Unity employee on why they are not going to have comments on documentation pages. That thread was locked, so I've posted my response here instead.

I wrote this because I think this stuff is really important. The documentation is not just "incomplete"; it is often out-of-date, misleading, and downright incorrect. The approach of throwing more people at the documentation team is completely missing the point: there is too much for you to document.

And, since our work forms part of the 'public face' of the company, we have to make sure that the content we produce - the grammar and language we use, the clarity and voice of the text, the screenshots, the layout and order of the pages, etc - all have to be consistent, and up to a certain quality which requires a process of writing, editing, proofing for english, proofing for technical correctness, an

@MattRix
MattRix / RXListReordering.cs
Created May 1, 2016 14:50
Extension methods for easily reordering an item in a list.
using UnityEngine;
using System;
using System.Collections.Generic;
public static class RXListReordering
{
public static bool CanReorder<T>(this List<T> items, T item, int dir)
{
var index = items.IndexOf(item);
if(index == -1) return false;
@MattRix
MattRix / RT.cs
Last active May 8, 2021 08:46
RT - Simple coroutine tweens
using System;
using System.Collections;
using UnityEngine;
public static class RT
{
static public IEnumerator Tween(float duration, Action<float> task, Func<float,float> easeFunc = null, float delay = 0)
{
while(delay > 0)
{
@MattRix
MattRix / RandomMover.cs
Last active May 8, 2021 08:47
RandomMover - A thing that uses RT
using UnityEngine;
using System.Collections;
using System;
using Random = UnityEngine.Random;
public class RandomMover : MonoBehaviour
{
public float distance = 1f;
public float duration = 1f;
public float delay = 0.0f;
@MattRix
MattRix / RTEase.cs
Last active October 16, 2016 16:22
RTEase - simple easing equations
public static class RTEase
{
public static Func<float,float> Linear = (t) => { return t; };
public static Func<float,float> Instant = (t) => { return t < 1f ? 0f : 1f;};
public static Func<float,float> QuadIn = (t) => { return t * t; };
public static Func<float,float> QuadOut = (t) => { return 2f*t - t*t;};
public static Func<float,float> QuadInOut = (t) => { return (t <= 0.5f) ? (t*t*2f) : (-1.0f + 4f*t + -2f*t*t);};
public static Func<float,float> CubeIn = (t) => { return t * t * t; };
public static Func<float,float> CubeOut = (t) => { return 1f - CubeIn(1f - t); };
public static Func<float,float> CubeInOut = (t) => { return (t <= 0.5f) ? CubeIn(t * 2f) * 0.5f : CubeOut(t * 2f - 1f) * 0.5f + 0.5f; };
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is a <b>cool</b> web site <i>all about <b>cool</b> stuff and <b>cool</b> things</i></p>
<p>Here's <a href="http://www.google.com">a link to a site</a></p>
<p>Here's a simple image <img src="http://i.imgur.com/TXhVsrq.gif" alt="cool dudes" width="300" height="165"/> being shown inline</p>
<ul>
{
"type": "html",
"content": [
{
"type": "head",
"content": [
{
"type": "title",
"content": [
"Hello world!"
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class PrefabManager : MonoBehaviour
{
static PrefabManager _instance;
static public PrefabManager Get()
@MattRix
MattRix / Displacer.shader
Created June 23, 2016 15:55
Shader for doing a displacement image effect
Shader "Effects/Displacer"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_DisplaceTex ("Displace (RGB)", 2D) = "gray" {}
}
SubShader
{