Skip to content

Instantly share code, notes, and snippets.

@WooshiiDev
WooshiiDev / BuildToolsWindow.cs
Last active December 8, 2023 09:50
Build Window for Unity, adding some flexibility into your projects! Make sure to add this to a folder named "Editor" so that Unity doesn't show errors when building your project/game
using System;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
using UnityEditorInternal;
using Debug = UnityEngine.Debug;
@luke161
luke161 / AddressablesSceneLoader.cs
Last active May 8, 2025 06:49
Handles loading and unloading of Scenes using Unity's Addressable Assets system. Adds support for using LoadSceneParameters when loading a scene, which is currently missing in the official APIs.
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.ResourceManagement;
using UnityEngine.ResourceManagement.ResourceLocations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
@WooshiiDev
WooshiiDev / SceneViewCameraHandler.cs
Created August 17, 2020 13:06
Simple Blender Like Camera Controls in the Scene View
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public static class SceneViewCameraHandler
{
public class SceneInfo
{
public SceneView view;
public Camera camera;
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@JimmyCushnie
JimmyCushnie / UnityGraphicsBullshit.cs
Last active February 19, 2025 10:59
Exposes some Unity URP graphics settings that are (for some stupid fucking bullshit reason) private.
using System.Reflection;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution;
/// <summary>
/// Enables getting/setting URP graphics settings properties that don't have built-in getters and setters.
@Nobuyuki-Kobayashi
Nobuyuki-Kobayashi / StrippingByVariantCollection.cs
Created April 8, 2020 06:28 — forked from wotakuro/StrippingByVariantCollection.cs
プロジェクト内にあるShaderVariantCollectionにないKeywordはビルドに含まないようにするEditor拡張です
/*
MIT License
Copyright (c) 2020 Yusuke Kurokawa
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
@LotteMakesStuff
LotteMakesStuff / NetworkingTools.cs
Last active April 28, 2023 09:49
Since Unity 2018.3 we've had this cool new tool called [SettingsProvider] that we can use to add custom settings menu into Unitys settings screens. This short example shows how i use [SettingsProvider] and some [MenuItems] to help build and run test clients when im developing a multiplayer game. My usecase is that i want a quick way to build and…
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
using Debug = UnityEngine.Debug;
public static class NetworkingTools
{
@Orixe
Orixe / FootIK
Last active December 17, 2023 15:22
Free Foot IK system for unity
using UnityEngine;
[RequireComponent(typeof(Animator))]
public class FootIK : MonoBehaviour
{
[Header("Main")]
[Range(0, 1)] public float Weight = 1f;
[Header("Settings")]
public float MaxStep = 0.5f;
public float FootRadius = 0.15f;
@phosphoer
phosphoer / ControllerIconMapDefinition.cs
Last active June 10, 2024 23:20
Rewired Glyph Mappings
using UnityEngine;
using System.Collections.Generic;
[CreateAssetMenu(fileName = "new-controller-icon-mapping", menuName = "Controller Icon Mapping")]
public class ControllerIconMapDefinition : ScriptableObject
{
[SerializeField]
private InputIconMapDefinition gamepadMap = null;
[SerializeField]
@ditzel
ditzel / PhysicsHelper.cs
Created January 20, 2019 16:54
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)