This file contains hidden or 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; | |
| // @kurtdekker | |
| // Make sure this is in an Editor folder! | |
| public static class DuplicationHelpers | |
| { | |
| // duplicates the current object and puts it back right after the original. | |
| [MenuItem( "Assets/Dupe Here FFS")] |
This file contains hidden or 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; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| // @kurtdekker - ultra Cheesy grid with in-built editor for Unity3D | |
| // | |
| // To use: | |
| // make an empty game object | |
| // drag this script on it |
This file contains hidden or 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; | |
| // @kurtdekker | |
| // Place on a GameObject, set the desired rate of spin | |
| public class SpinOnY : MonoBehaviour | |
| { | |
| [Header( "Degrees per second.")] | |
| public float RateOfRotation = 200.0f; |
This file contains hidden or 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 CallWhenTrue : MonoBehaviour | |
| { | |
| System.Func<bool> test; | |
| System.Action action; | |
| public static CallWhenTrue Create( System.Func<bool> test, System.Action action) | |
| { | |
| CallWhenTrue cwt = new GameObject("CallWhenTrue").AddComponent<CallWhenTrue>(); |
This file contains hidden or 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
| // | |
| // Script originally from user @Zer0cool at: | |
| // | |
| // https://forum.unity.com/threads/terrain-leveling.926483/ | |
| // | |
| // Revamped by @kurtdekker as follows: | |
| // | |
| // - put this on the object (or object hierarchy) with colliders | |
| // - drag the terrain reference into it | |
| // - use the editor button to "Stamp" |
This file contains hidden or 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; | |
| // @kurtdekker | |
| public static class GeometryHelpers | |
| { | |
| public static void ApplyMeshScaling( GameObject go, float scale) | |
| { | |
| var MeshFilters = go.GetComponentsInChildren<MeshFilter>(); |
This file contains hidden or 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
| // | |
| // @kurtdekker | |
| // | |
| // ULTRA-simple fully-static GameManager for simple arcade-style games. | |
| // | |
| // NOTE: you DO NOT place this file into any scene! It is a pure static data container. | |
| // | |
| // Usage: | |
| // - at start of game call GM.InitGame() | |
| // - when you earn points, call GM.AddPoints(1234); |
This file contains hidden or 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.Collections; | |
| using UnityEditor; | |
| // @kurtdekker | |
| // You must put this in an Editor folder! | |
| // Once compiled, you must run it from Menu -> Assets -> ReadInputManager | |
| public class ReadInputManager |
This file contains hidden or 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; | |
| // @kurtdekker | |
| // Ultra-simple clean stateless in-game pause/unpause mechanism. | |
| // TODO: | |
| // - put one of these script instances in your running game scene | |
| // - be sure to set Time.timeScale = 1 when your game starts | |
| public class InGamePause : MonoBehaviour | |
| { |
This file contains hidden or 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.EventSystems; | |
| // @kurtdekker | |
| // cheap and cheerful "increase the size of the focused button" | |
| public class ScaleOnFocus : MonoBehaviour | |
| { | |
| [Header( "Percent increase +10%, etc.")] | |
| public float PercentIncrease = 10; |