Skip to content

Instantly share code, notes, and snippets.

View AnomalousUnderdog's full-sized avatar
😨
Trial and errors with using Git LFS for the first time. Mostly errors.

AnomalousUnderdog

😨
Trial and errors with using Git LFS for the first time. Mostly errors.
View GitHub Profile
@DamianSuess
DamianSuess / SpecialFolderLocations.md
Last active February 2, 2024 19:25
C# Environment.SpecialFolder
@EmmaEwert
EmmaEwert / FirstPersonInputModule.cs
Created August 17, 2018 13:19
Replacement for Unity's StandaloneInputModule, world-space UI now reacts to first person locked cursor, screen center being the pointer position.
using UnityEngine;
using UnityEngine.EventSystems;
public class FirstPersonInputModule : StandaloneInputModule {
protected override MouseState GetMousePointerEventData(int id) {
var lockState = Cursor.lockState;
Cursor.lockState = CursorLockMode.None;
var mouseState = base.GetMousePointerEventData(id);
Cursor.lockState = lockState;
return mouseState;
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@dustingraham
dustingraham / AutoSave.cs
Last active March 1, 2024 09:19
Auto-Save open unity scenes when launching play mode, or every five minutes.
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
[InitializeOnLoad]
public class AutoSave
{
private static DateTime nextSaveTime;
@svermeulen
svermeulen / MultiSceneSetup.cs
Created October 23, 2016 17:32
Simple editor script to save and load multi-scene setups within Unity3D
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEditor.SceneManagement;
using UnityEditor;
using System.Collections;
using System.Linq;
public class MultiSceneSetup : ScriptableObject
{
//#define DEBUG_THREADING
using UnityEngine;
using System.Collections;
using System.Threading;
using System.Reflection;
public delegate IEnumerator MonitorCoroutine<T> (CoroutineData<T> data);
@stramit
stramit / UnityMethodValidator.cs
Last active June 10, 2019 16:16
Unity Method Validator
//Enable this if you want it to work in NUNIT, see the test example at the bottom
//#define UNIT_TESTING
/**
*
* https://i.imgur.com/GoH9rkv.png
*
* One of the frustrating things about Unity is that there are a spate of magic methods that can be
* called from the runtime. They do not have an interface defined, which by itself is pretty frustrating,
* but it can allow some valid c# that is bad Unity mojo. Consider a private 'OnEnable' function unity