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 System; | |
using System.Diagnostics; | |
/// <summary> | |
/// Simple benchmark class to measure average time consumption of code. | |
/// </summary> | |
public static class Benchmark | |
{ | |
/// <summary> | |
/// A benchmark's time result. |
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 UnityEngine.LowLevel; | |
using System.Collections.Generic; | |
using UnityEngine.PlayerLoop; | |
/// <summary> | |
/// Interpolates a GameObject's position and rotation while being updated in FixedUpdate. | |
/// </summary> | |
public class FixedUpdateInterpolation : MonoBehaviour |
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; | |
/// <summary> | |
/// This template allows to define code that runs independently of any GameObjects or Components created in the editor, even though using Unity events. | |
/// It can be used for any Scene-independent code, including coroutines, without having to manually add a component to a scene. | |
/// </summary> | |
public static class MyStaticCode | |
{ | |
[RuntimeInitializeOnLoadMethod] | |
private static void Initialize() |
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 System; | |
using System.Collections; | |
using UnityEngine; | |
/// <summary> | |
/// Replaces MonoBehaviour.Invoke and MonoBehaviour.InvokeRepeating | |
/// with a more sophisticated attempt. Namely: No strings involved. | |
/// Use like this: | |
/// StartCoroutine(Invoker.Invoke(MyMethod, 2)); | |
/// </summary> |
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
using UnityEngine; | |
[System.Serializable] | |
public struct FloatRange | |
{ | |
public float min; | |
public float max; | |
public float range { get { return Mathf.Abs(max - min); } } | |
public FloatRange(float min, float max) |
OlderNewer