Skip to content

Instantly share code, notes, and snippets.

@adammyhre
adammyhre / FixUnityBrokenSelectionBase.cs
Created August 7, 2024 19:27
Custom Unity Editor Script to Fix [SelectionBase] for Consistent Parent Selection
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
// Put this in an Editor folder
[InitializeOnLoad]
public class FixUnityBrokenSelectionBase : Editor {
static List<Object> newSelection;
static Object[] lastSelection = { };
@thelebaron
thelebaron / SearchInspector.cs
Last active September 19, 2024 00:06
search for unity's inspector
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Junk.Utilities
{
/// <summary>
/// Thanks to Ryiah and the collective stolen knowledge of the internet via chatgpt
/// https://forum.unity.com/threads/still-no-search-field-in-the-inspector.1555850/#post-9697247
@adammyhre
adammyhre / InspectorLock.cs
Last active April 13, 2025 18:15
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
@basnijholt
basnijholt / cto_line.pine
Created September 18, 2021 08:23
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
@macostag
macostag / setup.ps1
Created November 24, 2020 01:15
Chocolatey script to setup Windows 10 malware analysis box.
#Bypass Execution Policy
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
#Install boxstarter
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1')); Get-Boxstarter -Force
#Disable UAC
Disable-UAC
#Disanle Micrsoft Update
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityToolbarExtender;
/// <summary>
@abdelfattahradwan
abdelfattahradwan / ViewManager.cs
Last active October 16, 2024 17:13
The View Manager script from the my UI management system YouTube video tutorial (https://youtu.be/rdXC2om16lo)
using System.Collections.Generic;
using UnityEngine;
public class ViewManager : MonoBehaviour
{
private static ViewManager s_instance;
[SerializeField] private View _startingView;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.SceneManagement;
static class EditorSceneSettingsExtension
{
[SettingsProvider]
public static SettingsProvider CreateStartSceneSettingsProvider()
{
/**
FinalIKを使ったLeapMotion Orion用HandController
(VRIKバージョン)
Author: MiyuMiyu (https://twitter.com/miyumiyuna5)
Source: https://qiita.com/miyumiyu/items/72b965df46a79f3ec523
Modified by: Emiliana (https://twitter.com/Emiliana_vt)
Modifications: Updated for current SDK version, supports hand position reset on tracking loss, hand mirroring and interpolation.
*/
/*
@Nesh108
Nesh108 / DiscordLogger.cs
Last active September 13, 2024 20:47
Unity Logger for posting Errors to Discord channel
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Networking;
// License: MIT
// Created by: Aceria_
// Edited by: Nesh108
// To use, add these to any MonoBehaviour:
// OnEnable: `Application.logMessageReceived += DiscordLogger.HandleLog;`