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 UnityEditor; | |
using UnityEngine; | |
using UnityEngine.LowLevel; | |
using System.Linq; | |
using System.Threading; | |
namespace EditorUtils { | |
// | |
// Serializable settings |
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; | |
namespace FMPUtils.Extensions | |
{ | |
public static class SpringMotion | |
{ | |
// Reference video: | |
// https://www.youtube.com/watch?v=bFOAipGJGA0 | |
// Instant "Game Feel" Tutorial - Secrets of Springs Explained (by Toyful Games) | |
// The channel LlamAcademy also made an adaption of the concept for Unity, |
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
// ==================================================================================================== | |
// In my codebase, all ships have their own instance of this that they use to apply physics with. | |
// I'm using a struct mostly because I want to maintain copy semantics. | |
// ==================================================================================================== | |
public struct FlightInput | |
{ | |
public float Pitch; | |
public float Yaw; | |
public float Roll; |
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.Collections; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using UnityEngine; | |
[RequireComponent(typeof(MeshFilter))] | |
[RequireComponent(typeof(MeshRenderer))] | |
public class Chunk : MonoBehaviour | |
{ | |
public MeshFilter meshFilter {get; private set;} = null; |
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
// Based on the Unity Wiki FloatingOrigin script by Peter Stirling | |
// URL: http://wiki.unity3d.com/index.php/Floating_Origin | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class FloatingOrigin : MonoBehaviour | |
{ | |
[Tooltip("Point of reference from which to check the distance to origin.")] | |
public Transform ReferenceObject = null; |
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; | |
[AttributeUsage(AttributeTargets.Method)] | |
public class ConsoleAccessAttribute : Attribute | |
{ | |
} |
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.Collections; | |
/// <summary> | |
/// A simple state machine class. Use it to run regular methods or coroutines as states. | |
/// Steps to use: | |
/// 1. Define a private field for the StateMachine object. | |
/// private StateMachine stateMachine; | |
/// 2. Initialize the object in Awake. Pass the MonoBehaviour object to the constructor. |
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 Colors | |
{ | |
// NOTE: The follwing color names come from the CSS3 specification, Section 4.3 Extended Color Keywords | |
// http://www.w3.org/TR/css3-color/#svg-color | |
public static readonly Color AliceBlue = new Color32(240,248,255,255); | |
public static readonly Color AntiqueWhite = new Color32(250,235,215,255); | |
public static readonly Color Aqua= new Color32(0,255,255,255); |
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
// NOTE DONT put in an editor folder | |
using UnityEngine; | |
public class HighlightAttribute : PropertyAttribute | |
{ | |
public HighlightColor Color; | |
public string ValidateMethod; | |
public object Value; |
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
// Wizard to convert a cubemap to an equirectangular cubemap. | |
// Put this into an /Editor folder | |
// Run it from Tools > Cubemap to Equirectangular Map | |
using UnityEditor; | |
using UnityEngine; | |
using System.IO; | |
class CubemapToEquirectangularWizard : ScriptableWizard { |
NewerOlder