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.Collections; | |
public class CallAfterDelay : MonoBehaviour | |
{ | |
float delay; | |
System.Action action; | |
// Will never call this frame, always the next frame at the earliest | |
public static CallAfterDelay Create( float delay, System.Action action) |
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.Collections; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[CreateAssetMenu(menuName = "Collections/GameObjectCollection")] | |
public class GameObjectCollection : ScriptableObject | |
{ |
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
/* | |
The following license supersedes all notices in the source code. | |
Copyright (c) 2021 Kurt Dekker/PLBM Games All rights reserved. | |
http://www.twitter.com/kurtdekker | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are | |
met: |
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
// From: https://answers.unity.com/questions/801928/46-ui-making-a-button-transparent.html?childToView=851816 | |
// | |
// @kurtdekker | |
// | |
// Touchable invisible non-drawing Graphic (usable with Buttons too): | |
// | |
// To make an invisible Button: | |
// | |
// 1. make a Button in the normal way | |
// 2. delete the "Text" GameObject which comes below a Button as standard |
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 UnityEngine; | |
// by @kurtdekker - to make a simple Unity singleton that has no | |
// predefined data associated with it, eg, a high score manager. | |
// | |
// To use: access with SingletonSimple.Instance | |
// | |
// To set up: |
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 UnityEngine; | |
// by @kurtdekker - to make a Unity singleton that has some | |
// prefab-stored, data associated with it, eg a music manager | |
// | |
// To use: access with SingletonViaPrefab.Instance | |
// | |
// To set up: |
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 UnityEngine; | |
// by @kurtdekker - handy example of simple persistent settings. | |
// | |
// To use, just use the variables like any other: | |
// | |
// SETTINGS.VolumeLevel = 1.0f; | |
// |
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 UnityEngine; | |
// @kurtdekker | |
// | |
// This is to take any continuous quantity and change it from one value | |
// to another over time. This code is for floats. It can be adapted to work for: | |
// | |
// Vector2, Vector3, Vector3 |
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
// Originally from: | |
// http://forum.unity3d.com/threads/script-simple-script-that-automatically-adjust-anchor-to-gui-object-size-rect-transform.269690/ | |
#if UNITY_EDITOR | |
using UnityEditor; | |
using UnityEngine; | |
using System.Collections; | |
public class AnchorExtensions : 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 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")] |
OlderNewer