Placr is now a package that you can download via package manager:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class FBXAxesFixer : AssetPostprocessor | |
{ | |
void OnPostprocessModel(GameObject g) | |
{ | |
if(assetImporter.ToString() == " (UnityEngine.FBXImporter)") | |
{ | |
FixFBXImport(g.transform, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class PathAttribute : PropertyAttribute | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
private const int executionOrder = -1000; | |
[UnityEditor.InitializeOnLoadMethod] | |
private static void SetScriptOrder() | |
{ | |
var go = new GameObject("Temp"); | |
var monoScript = UnityEditor.MonoScript.FromMonoBehaviour(go.AddComponent<NAME_OF_THIS_MONOBEHAVIOUR>()); | |
if (UnityEditor.MonoImporter.GetExecutionOrder(monoScript) != executionOrder) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Re-enables pre-2018.x scene view camera behaviour for arrow keys. | |
/// Allows the user to move the scene view camera on a horizontal plane. | |
/// </summary> | |
public static class ClassicEditorArrowMovement | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Threading; | |
/// <summary> | |
/// Orders the Threadpool to perform an action and waits until it's done. | |
/// Use for short actions that maybe are performed more often. | |
/// </summary> | |
public class CoroutinePoolThread : CustomYieldInstruction | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class EventOrderTest : MonoBehaviour | |
{ | |
private bool firstUpdate = true; | |
private void Awake() | |
{ | |
Log("Awake"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Extension methods to create simple code around working with WeakReferences referencing UnityEngine.Objects. | |
/// </summary> | |
public static class WeakReferenceExtensions | |
{ | |
/// <summary> | |
/// Destroys the referenced object if it still exists. | |
/// Does nothing if no object is referenced or the referenced object is already destroyed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Create a subclass of this class to manipulate particles in Update any way you see fit. | |
/// </summary> | |
[RequireComponent(typeof(ParticleSystem))] | |
[ExecuteInEditMode] | |
public abstract class ParticleManipulator : MonoBehaviour | |
{ | |
new protected ParticleSystem particleSystem { get; private set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
/// <summary> | |
/// Temporarily set a color to be used for Gizmos. | |
/// <example> | |
/// <code> | |
/// using (new GizmosColor(Color.red)) | |
/// { |
OlderNewer