Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View radiatoryang's full-sized avatar

Robert Yang radiatoryang

View GitHub Profile
@danieldownes
danieldownes / RandomPointOnMesh.cs
Last active April 9, 2024 12:14 — forked from v21/gist:5378391
Random point on a mesh, for Unity3D
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// Get total area of each triangle.
/// Find a random point within that total area.
/// Lookup which triangle that point relates to
/// Find a randiom point which point that triangle
/// This works for all mesh types, and gives fully distributed results.
/// Gist: https://gist.github.com/danieldownes/b1c9bab09cce013cc30a4198bfeda0aa
@Yanrishatum
Yanrishatum / heapsfaq.md
Last active November 7, 2023 11:04
An Unofficial Heaps FAQ

An Unofficial Heaps FAQ

I (Yanrishatum) see too many same questions. They irritate me.

Translation

"How dare you come into this chat and not realize that i am the GOD of heaps and that you MUST check out MY documentation1!!! Im veyr abngrey!!!" - translation from someone in chat.

Very accurate, I highly approve.

@Farfarer
Farfarer / Cable.cs
Created July 5, 2016 15:45
Catenary curves in Unity. Creates a catenary curve between two points with a given amount of slack. http://farfarer.com/temp/unity_cables.png
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
[System.Serializable]
public class CableCurve {
[SerializeField]
Vector3 m_start;
@MattRix
MattRix / UnityEditorIcons.txt
Last active April 19, 2024 09:14
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
@LordNed
LordNed / ConsoleEntry.prefab
Created October 16, 2015 19:55
HTC Vive in-vr Console Viewer. Add the ConsoleLogger script to a gameobject in your scene, and then the UIConsoleViewer to the controller or object you want the console to track. It has a somewhat complicated prefab setup so the prefabs have been attached at the end. I have no idea if you can distribute prefabs this way, so someone gets to find …
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &121470
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 224: {fileID: 22423080}
using System;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
/// <summary>
/// Simple toggle -- something that has an 'on' and 'off' states: checkbox, toggle button, radio button, etc.
/// </summary>
[AddComponentMenu("UI/Toggle", 35)]
@jakevsrobots
jakevsrobots / SharecartOneThousand.cs
Last active September 3, 2019 19:05
A helper script to read/write SHARECART1000 save files. See http://sharecart1000.com/ for more info!
/*************************************************
SHARECART1000 helper script:
This script reads/writes data according to the
shared savegame file specified here:
http://sharecart1000.com/
Put this script on some game object in your
scene. You can use a sample text file in the
sharecart format and assign it to the property
@MattRix
MattRix / RXDivider.cs
Last active November 15, 2022 22:55
Adds dividers into the inspector. Based on a brilliant idea by Matthew Wegner, see: https://twitter.com/mwegner/status/355147544818495488
//Based on a brilliant idea by Matthew Wegner - https://twitter.com/mwegner/status/355147544818495488
//Code for drawing the base PropertyDrawers is from here: http://forum.unity3d.com/threads/173401-Getting-Default-SerializedProperty-Drawing-within-a-PropertyDrawer?p=1186347&viewfull=1#post1186347
//My implementation is super lazy with magic numbers everywhere! :D
#if UNITY_EDITOR
using System;
using UnityEngine;
using System.Collections.Generic;
using UnityEditor;