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; | |
[ExecuteInEditMode] | |
public class CameraFollow : MonoBehaviour | |
{ | |
[Tooltip( "Object to follow" )] | |
public Transform Target; | |
[Tooltip( "Target distance to the followed object" )] | |
public Vector3 DistanceToTarget = new Vector3( 0f, 3f, -5f ); |
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_2019_1_OR_NEWER | |
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public class EditorCameraZoomWithScrollWheel | |
{ | |
private const float CAMERA_SPEED = -0.25f; | |
private static bool rmbDown = false; |
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
//#define TMP_ROUND_DECIMALS // When defined, float and double values are rounded using Math.round | |
using TMPro; | |
public static class TMP_IntegerText | |
{ | |
private static readonly char[] arr = new char[64]; // prefix + number + postfix can't exceed this capacity! | |
private static int charIndex = 0; | |
public static void SetText( this TMP_Text text, sbyte number ) |
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.Diagnostics; | |
using System.IO; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEngine; | |
public class OpenShaderInNotepad | |
{ | |
private const string NPP1 = @"C:\Program Files\Notepad++\notepad++.exe"; | |
private const string NPP2 = @"C:\Program Files (x86)\Notepad++\notepad++.exe"; |
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.IO; | |
using UnityEngine; | |
public static class ScreenshotCapture | |
{ | |
// Saves the screenshot to desktop | |
public static void Capture() | |
{ | |
string saveDirectory = Environment.GetFolderPath( Environment.SpecialFolder.DesktopDirectory ); |
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
// Uses ZipStorer (c) 2016 Jaime Olivares [v3.4.0; August 4, 2017] (MIT-License: https://github.com/jaime-olivares/zipstorer/blob/master/LICENSE.md) | |
using System.Collections.Generic; | |
using System.Text; | |
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using UnityEditor; | |
using UnityEngine; |
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
var checkDocument = function( doc ) | |
{ | |
var frames = doc.getElementsByTagName( "iframe" ); | |
for( var i = 0, l = frames.length; i < l; i++ ) | |
checkIframe( frames[i] ); | |
}; | |
var checkIframe = function(iframe) | |
{ | |
if( iframe.src.indexOf( "https://www.youtube" ) == 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.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
namespace SimplePatchToolCore | |
{ | |
public class SimpleArchive | |
{ | |
// Archive Structure |
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; | |
[ExecuteInEditMode] | |
[RequireComponent( typeof( Camera ) )] | |
public class HorizontalCamera : MonoBehaviour | |
{ | |
private Camera m_camera; | |
private float lastAspect; | |
#pragma warning disable 0649 |
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.Generic; | |
using UnityEngine; | |
using UnityEngine.Sprites; | |
using UnityEngine.UI; | |
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER | |
using UnityEngine.U2D; | |
#endif | |
using Sprites = UnityEngine.Sprites; | |
#if UNITY_EDITOR |