Skip to content

Instantly share code, notes, and snippets.

@TiliSleepStealer
TiliSleepStealer / DoomGlow.cs
Created June 13, 2017 21:45
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@radiatoryang
radiatoryang / SkinnedMeshObjectPreviewExample.cs
Last active October 7, 2022 10:07
An example of a custom ObjectPreview rendering out a SkinnedMesh for Unity Editor C#... I used it for facial expressions and blendshape editing, you might want to use it for something else. I hereby place it under MIT License. Full write-up here: http://www.blog.radiator.debacle.us/2016/06/working-with-custom-objectpreviews-and.html
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
[CustomPreview(typeof(YourCustomScriptableObject))] // THIS IS VERY IMPORTANT, this is so the editor knows what this is supposed to be previewing at all
public class SkinnedMeshObjectPreviewExample : ObjectPreview {
PreviewRenderUtility m_PreviewUtility;
@linadk
linadk / UnetHelloWorld
Created June 19, 2015 18:37
Using the Unity3d Unet LLAPI this will establish a connection and send data. There aren't many examples out there for this currently so I thought I'd write this up.
/// <summary>
/// UNet LLAPI Hello World
/// This will establish a connection to a server socket from a client socket, then send serialized data and deserialize it.
/// </summary>
using UnityEngine;
using System.Collections;
using UnityEngine.Networking;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
@digitalshadow
digitalshadow / OpenSimplexNoise.cs
Last active February 4, 2024 13:51
OpenSimplex Noise Refactored for C#
/* OpenSimplex Noise in C#
* Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
* and heavily refactored to improve performance. */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace NoiseTest
@omgwtfgames
omgwtfgames / NoiseTexture.cs
Last active March 17, 2021 00:18 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise function based on the Simplectic honeycomb - C# port
/*
* OpenSimplex (Simplectic) Noise Test for Unity (C#)
* This file is in the Public Domain.
*
* This file is intended to test the functionality of OpenSimplexNoise.cs
* Attach this script to a GameObject with mesh (eg a Quad prefab).
* Texture is updated every frame to assist profiling for performance.
* Using a RenderTexture should perform better, however using a Texture2D
* as an example makes this compatible with the free version of Unity.
*
@GregMalick
GregMalick / shootRay
Last active September 24, 2019 11:25
''' this Command fires a ray down the +Z axis of a locator at a mesh
and selects any poly that the ray intersects
does not yet handle animated positions
Command format:
shootRay LocatorName MeshName '''
NAME_CMD_SHOOTRAY = "shootRay"
NAME_ARG_LOCATOR = "StrLocatorName"
NAME_ARG_MESH = "StrMeshName"
using UnityEngine;
using System.Collections;
public class NetworkInterpolatedTransform : MonoBehaviour
{
public double interpolationBackTime = 0.1;
internal struct State
{
internal double timestamp;