Skip to content

Instantly share code, notes, and snippets.

View noisecrime's full-sized avatar

NoiseCrime noisecrime

View GitHub Profile
@noisecrime
noisecrime / Unity-UnityPrimitives
Last active August 16, 2024 12:49
On-Demand access, loading & caching of Unity BuiltInResource Primitive Type Meshes.
using System;
using UnityEngine;
namespace NoiseCrimeStudios.Core.UnitySupport
{
/// <summary>
/// On-Demand access, loading & caching of Unity BuiltInResource Primitive Type Meshes.
/// </summary>
public static class UnityPrimitives
{
@noisecrime
noisecrime / Unity-FBX2BlenderImporter.cs
Last active August 15, 2024 08:28
Unity Editor script that allows you to double-click a fbx file in the project browser and it will open and import into Blender.
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
/// <summary>
@noisecrime
noisecrime / Unity-ReferenceChecker.cs
Last active August 13, 2024 00:33
WIP - Simple editor script to provide options in dropdown menu when clicking on an asset in the project browser to discover what other assets/scenes reference it.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
/// <summary>
/// NoiseCrimeStudio OneShots are single scripts that provide specific funactionality.
/// </summary>
namespace NoiseCrimeStudios.OneShot.Editor

Unity versions not affected by Unity Runtime Fee

This is information that has been dug up by me and others in the Unity community. It's not official information from Unity (but most of the linked resources are). It is also not legal advise. I am not a lawyer.

TLDR:

Contrary to what Unity themselves are saying, for games made with these Unity versions, developers can elect not to be affected by a newer version of the Terms of Service that introduces the Unity Runtime Fee:

  • Unity 2022.x or earlier
  • Unity 2021.x LTS or earlier
@noisecrime
noisecrime / Unity-InternalScreenShotting.cs
Last active August 13, 2024 00:33
Exposes the native Unity 'ScreenShotting' methods to Unity Menu & Shortcut keys.
using UnityEditor;
using UnityEngine;
/// <summary>
/// NoiseCrimeStudio OneShots are single scripts that provide specific funactionality.
/// </summary>
namespace NoiseCrimeStudios.OneShot.Editor
{
/// <summary>
/// Exposes the native Unity 'ScreenShotting' methods to Unity Menu & Shortcut keys.
@noisecrime
noisecrime / Unity-AssemblyDefinitionDebugger.cs
Last active August 13, 2024 00:32 — forked from karljj1/Unity Assembly Definition Debugger.cs
Find out what assemblies are being built and how long each takes.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
/// <summary>
/// NoiseCrimeStudio OneShots are single scripts that provide specific funactionality.
@noisecrime
noisecrime / ResourceChecker.cs
Last active October 11, 2021 14:00
Unity: Quick update to original 'Unity-Resource-Checker' to use native Unity methods for obtaining the memory size of textures.
// Resource Checker
// (c) 2012 Simon Oliver / HandCircus / [email protected]
// (c) 2015 Brice Clocher / Mangatome / [email protected]
// Public domain, do with whatever you like, commercial or not
// This comes with no warranty, use at your own risk!
// https://github.com/handcircus/Unity-Resource-Checker
// (c) 2019 NoiseCrime
// Quick update to use native Unity methods to obtain the size of textures.
// Looking through the code much has changed since this class was first created
// as such it requires a full rewrite to fix various issues and robustly deal
@noisecrime
noisecrime / UpdateInspectorBehaviour.cs
Created September 13, 2018 11:36
Example of how to expose a field from a class reference and have it update the inspector at an 'appropriate' framerate
using UnityEngine;
public class UpdateInspectorBehaviour : MonoBehaviour
{
public class CustomValueClass
{
public int _MyUpdatingValue;
}
public CustomValueClass _CustomValueClass;
@noisecrime
noisecrime / WebcamProcessingTesting.cs
Created May 1, 2018 06:58
Optimizing step for WebProcessing
using UnityEngine;
using Unity.Jobs;
using Unity.Collections;
using Unity.Mathematics;
public class WebcamProcessingTesting : MonoBehaviour
{
[SerializeField]
[Tooltip("Which webcam to use")]
int m_WebcamIndex;
@noisecrime
noisecrime / StopWatchProfiler
Created September 10, 2017 10:31
StopWatchProfiler
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
#if UNITY_5_5_OR_NEWER
using Profiler = UnityEngine.Profiling.Profiler;
#endif
public class StopWatchProfiler : MonoBehaviour