Skip to content

Instantly share code, notes, and snippets.

@runevision
runevision / ErosionNoise.cs
Last active September 10, 2025 11:35
Erosion noise implementation in C#
/*
Erosion noise implementation in C# (with the Unity.Mathematics package),
ported one-to-one from the Shadertoy shader code by Fewes and clayjohn.
Please note that while the majority of the code is provided under the MIT license,
the quite central "erosion" function is adapted from code shared under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Shadertoy comment by Fewes from https://www.shadertoy.com/view/7ljcRW :
@Kosmik123
Kosmik123 / FogColorSynchronization
Created May 24, 2025 14:24
Synchronize Camera background color and Scene fog color in Unity
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
public static class FogColorSynchronization
{
private const string EnableSyncMenuItemPath = "CONTEXT/Camera/Enable Synchronize Fog Color";
private const string DisableSyncMenuItemPath = "CONTEXT/Camera/Disable Synchronize Fog Color";
private enum ColorChange
@friflo
friflo / ECS-types.cs
Last active May 22, 2025 19:27
ECS component types for collision detection - https://github.com/friflo/Lab-ECS-collisions
// more info at: https://github.com/friflo/Lab-ECS-collisions
struct Position2D : IComponent
{
public Vector2 pos;
}
struct ColliderBox : IComponent
{
public Vector2 size;
@purrplingcat
purrplingcat / CollisionDetector.cs
Created May 22, 2025 11:07
ECS collisions (ineffective&slow)
using Arch.Core;
using Arch.Core.Extensions;
using Collections.Pooled;
using Lydia.Components;
using Lydia.Utilities;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
public class CollisionDetector
@atcarter714
atcarter714 / AssistantsSchemas.cs
Created April 3, 2025 19:12
A C# script file (CSX) implementing the OpenAI API (also works as regular C# code) ...
/* --------------------------------------------------------------------------------
* Notes (AssistantsSchemas.cs) ::
* --------------------------------------------------------------------------------
* This file contains a set of classes and interfaces that define the structure
* of the JSON objects that are used to interact with the OpenAI API. These objects
* are used to serialize and deserialize JSON data to and from C# objects.
* We use System.Text.Json for this purpose, and the classes in this file are
* designed to work with the default JSON serialization options provided by the
* System.Text.Json library (higher performance than Newtonsoft.Json).
*
@KaganAyten
KaganAyten / ButtonSelectedCursorController.cs
Created January 11, 2025 03:19
Simple Joystick Navigator
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public class ButtonSelectedCursorController : MonoBehaviour
{
@yasirkula
yasirkula / CommentComponent.cs
Created November 4, 2024 19:15
Adding comments to Inspector via a component in Unity
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[AddComponentMenu("Comment")]
public class CommentComponent : MonoBehaviour
{
#if UNITY_EDITOR
[SerializeField]
@aras-p
aras-p / unity_6_empty_web_build.md
Last active October 24, 2025 07:28
Unity 6 "empty" web build file sizes

This short post by Defold people about "empty project build size" comparison between Defold, Unity and Godot (twitter, mastodon) sparked my interest.

It is curious that Godot builds seem to be larger than Unity? Would not have expected that! Anyway.

A way more extensive Unity "web" build comparison and analysics is over at https://github.com/JohannesDeml/UnityWebGL-LoadingTest but here are just my short notes in trying out Unity 6 (6.0.23 - Oct 2024).

Default (3D, URP) template

@mitay-walle
mitay-walle / RenameMixamoAnimations.cs
Last active September 27, 2024 08:36
Unity3d Menu Item to rename "Mixamo" animations to same as file-name
[MenuItem("Assets/Rename Animations")]
private static void RenameAnimations()
{
Selection.objects.Where(EditorUtility.IsPersistent)
.Select(AssetDatabase.GetAssetPath)
.ForEach(path =>
{
string fileName = Path.GetFileNameWithoutExtension(path);
ModelImporter importer = (ModelImporter)AssetImporter.GetAtPath(path);
@jamiephan
jamiephan / README.md
Last active October 23, 2025 13:41
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com