Skip to content

Instantly share code, notes, and snippets.

@Belphemur
Belphemur / sandbox-winget.ps1
Last active July 17, 2023 00:32
Use Windows Sandboxing to be able to install your WinGet manifest. Source: https://megamorf.gitlab.io/2020/07/19/automating-the-windows-sandbox/
# Parse Arguments
Param(
[Parameter(Mandatory, HelpMessage = "The path for the Manifest.")]
[String] $Manifest
)
if (-not (Test-Path -Path $Manifest -PathType Leaf)) {
throw 'The Manifest file does not exist.'
}
@ttgodev
ttgodev / JawController.cs
Last active April 30, 2021 04:21
Unity Reallusion Character Creator 3 Mouth Open Fix
/// Intended Use: Unity Reallusion Character Creator 3 Mouth Open Fix
/// Example Usage (at video time 2:00-2:24) : https://youtu.be/I9lT5sKLI6Q?t=120
/// This script resolves a bug with Reallusion Character Creator 3 models where the mouth is open by default.
/// Controls the rotation of the Jaw Bone using a min/max range based on the Mouth_Open BlendShape.
/// Setup Instructions
/// 1. Attach it to your character model game object
@acoppes
acoppes / AssetDatabaseExt.cs
Last active July 10, 2023 12:45
Unity Editor helper methods to get Prefabs with one or more specific components from the assets database.
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Utils.Editor
{
public static class AssetDatabaseExt
{
@empika
empika / SceneViewEditorBoilerplate.cs
Last active July 17, 2021 02:01
SceneViewEditorBoilerplate
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneViewEditorBoilerplate : ScriptableObject
{
public const string SVE_IS_ENABLED = "SVE_IS_ENABLED";
EditorApplication.ExecuteMenuItem("Window/Analysis/Frame Debugger");
@jeffvella
jeffvella / AddressablesLoader.cs
Last active April 29, 2024 16:55
Loader script for caching addressables to load syncronously.
using System;
using System.Collections.Generic;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceLocations;
using Object = UnityEngine.Object;
public class AddressableLabels
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Unity.Physics.Authoring;
#if UNITY_EDITOR
using UnityEditor;
#endif
[Serializable]
@openroomxyz
openroomxyz / RunScriptInEditModeAndReciveInput.cs
Last active July 14, 2020 11:15
Unity : How can i run a script in in edit mode (Not Runtime) when i select some object, and i wish to receive user input (Edit update loop) and Instantiate and object on key-press ?
using UnityEditor;
using UnityEngine;
//How can i run a script in at at edit time (Not Runtime) when object is selected, and recive user input (Edit update loop) ?
//Editor scripts have to be in folder named Editor
//[CustomEditor(typeof(GameObject))] ensures that this peace of code will run only when we have GameObject selected so we are save to cast object to GameObject [selectedTarget = (GameObject)target;]
[CustomEditor(typeof(GameObject))] //This is custom editor for the type GameObject ( This script will kick in when we have game object selected )
public class CubeEditor : Editor
{
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
public static class AssetDatabaseUtils
{
public static T FindAsset<T>() where T : UnityEngine.Object
{
return FindAssets<T>().FirstOrDefault();
}
@Kleptine
Kleptine / ConstructionScript.cs
Created March 16, 2020 02:36
A Construction Script is a system to help generate procedural Gameobjects at Edit-Time in a Unity scene. It does /// three main things: /// <para>1. Generates a child gameobject wrapped in a <see cref="HideFlags.DontSave" /> gameobject.</para> /// <para> /// 2. Runs a set of <see cref="IOnConstruct" /> scripts on this generated object, whenever …
using System.Linq;
using UnityEngine;
#if UNITY_EDITOR
using System;
using UnityEditor;
#endif
namespace Global.Scripts.ConstructionScript
{