Skip to content

Instantly share code, notes, and snippets.

@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@Flafla2
Flafla2 / Perlin.cs
Last active April 25, 2024 15:04
Improved Perlin Noise Implementation in C#
public class Perlin {
public static double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
double frequency = 1;
double amplitude = 1;
for(int i=0;i<octaves;i++) {
total += perlin(x * frequency, y * frequency, z * frequency) * amplitude;
amplitude *= persistence;
@Ikalou
Ikalou / git_and_unity.md
Last active April 22, 2024 04:01
Git and Unity

EDIT: this is an old post and a lof the information in this document is outdated.

Using Git with Unity

Git logo

Git is a popular free and open source distributed version control system.

I am new to Unity, but as a long time git user, I wanted to use git for my

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 18, 2024 00:47
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@diego-augusto
diego-augusto / smart-merging-unity.md
Last active April 24, 2023 11:05
Smart Merging in Unity with Meld (Windows)
  1. In Unity, go to Edit > Project Settings > Edit > Asset Serialization > Mode and select Force Text.
  2. Add UnityYAMLMerge.exe in %PATH%. (C:\Program Files\Unity\Editor\Data\Tools)
  3. In .gitconfig (C:\Users<user>) add at the end of the file:
	[merge]
		tool = unityyamlmerge
	[mergetool "unityyamlmerge"]
		trustExitCode = false
		cmd = UnityYAMLMerge merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active June 15, 2024 02:13
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@alexcambose
alexcambose / first_names.txt
Created February 19, 2018 21:33
List of first names
AAFILE
AANEI
AARSHAT
ABA
ABABEI
ABABI
ABABIE
ABADAL
ABADI
ABADY
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@cheesits456
cheesits456 / RemoveButtons.theme.css
Last active June 16, 2024 17:53
Custom CSS for Discord to remove the GIF picker and Nitro Gift buttons from the message bar
/**
* @name Remove Buttons
* @version 1.1.1
* @author cheesits456
* @authorId 306018440639152128
* @description Remove the nitro gift, GIF picker, and sticker picker buttons from the message box. Also remove the sticker suggestion popup
* @source https://gist.github.com/cheesits456/41d659f932b5a574b5dfb9b391a4506e
* @invite 7QH4YeD
* @donate https://donate.haileybot.com
* @website https://cheesits456.dev