Skip to content

Instantly share code, notes, and snippets.

View SenshiSentou's full-sized avatar

Patrick Boelens (bluetomato) SenshiSentou

View GitHub Profile
@SenshiSentou
SenshiSentou / CustomHoldingInteraction.cs
Last active July 11, 2023 14:11 — forked from Invertex/CustomHoldingInteraction.cs
Unity New Input System custom Hold "Interaction" where the .performed callback is constantly triggered while input is held.
using UnityEngine;
using UnityEngine.InputSystem;
//!!>> This script should NOT be placed in an "Editor" folder. Ideally placed in a "Plugins" folder.
namespace Invertex.UnityInputExtensions.Interactions {
//https://gist.github.com/Invertex
/// <summary>
/// Custom Hold interaction for New Input System.
/// With this, the .performed callback will be called everytime the Input System updates.
/// Allowing a purely callback based approach to a button hold instead of polling it in an Update() loop or creating specific logic for it
@SenshiSentou
SenshiSentou / 82-Scriptable Object-NewScriptableObject.cs.txt
Last active April 1, 2021 06:58
Save this script in the following location as `82-Scriptable Object-NewScriptableObject.cs.txt`: Windows: C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates Mac (since 5.2.1f1): /Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates
using UnityEngine;
[CreateAssetMenu(menuName = "Custom/#SCRIPTNAME#", fileName = "New #SCRIPTNAME#", order = 10)]
public class #SCRIPTNAME# : ScriptableObject {
#NOTRIM#
}