Skip to content

Instantly share code, notes, and snippets.

View gamemachine's full-sized avatar

Chris Ochs gamemachine

View GitHub Profile
@mzandvliet
mzandvliet / DspApplication.cs
Last active July 23, 2022 00:13
A quick example of how to play a mouse-controlled sine wave using the DSPGraph preview package
using UnityEngine;
using Unity.Collections;
using Unity.Audio;
using Unity.Mathematics;
using Unity.Burst;
using System.Collections;
/*
For allocations inside AudioKernels, use Allocator.AudioKernel
*/
@LotteMakesStuff
LotteMakesStuff / NativeMeshTest.cs
Created August 8, 2018 00:30
[NativeCollections] How to copy a regular .C# array into a NativeArray suuuuuper quick using memcpy. its about as fast as its ever gunna get!
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using UnityEngine;
public class NativeMeshTest : MonoBehaviour
{
private NativeArray<float3> vertexBuffer;
private Vector3[] vertexArray;
// RaiseTerrain.cs -- a simple script that raises (or lowers) Unity's built in terrain to be level
// with a GameObject's collider(s).
//
// AUTHOR: Martin "quill18" Glaude -- quill18@quill18.com
// LICENSE: CC0
//
// The latest version will always be available at: https://gist.github.com/quill18/9becf56f685e60109551e034385fd8f9
//
using UnityEngine;
@mattvr
mattvr / CurvedPlane.cs
Created June 29, 2016 04:29
Curved plane for Unity
/*
MIT License
Copyright (c) 2016 Matt Favero
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@StagPoint
StagPoint / QuaternionCompression.cs
Last active April 1, 2024 16:54
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using