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
syntax: glob | |
.DS_Store | |
*.sln | |
*.userprefs | |
*.csproj | |
*.pidb | |
*.unitypackage | |
syntax: regexp | |
^Build/.* |
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; | |
using UnityEngine.SceneManagement; | |
public class Helper : MonoBehaviour | |
{ | |
public static List<T> FindThemAll<T>(bool includeInactive = false) where T : UnityEngine.Component | |
{ | |
var scene = SceneManager.GetActiveScene(); |
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; | |
[CustomPropertyDrawer(typeof(Sprite))] | |
public class SpritePropertyDrawer : PropertyDrawer | |
{ | |
public override float GetPropertyHeight(SerializedProperty property, GUIContent labelN) | |
{ | |
if (property.objectReferenceValue != 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
{"frames": { | |
{% for sprite in spritesAndAliases %} | |
"{{ sprite.name }}": | |
{ | |
"frame": {"x":{{ sprite.textureRectX }},"y":{{ sprite.textureRectY }},"w":{{ sprite.textureRectWidth }},"h":{{ sprite.textureRectHeight }}}, | |
"rotated": {% if sprite.isRotated %}true{% else %}false{% /if %}, | |
"trimmed": {% if sprite.isTrimmed %}true{% else %}false{% /if %}, | |
"spriteSourceSize": {"x":0,"y":0,"w":{{ sprite.sourceSizeWidth }},"h":{{ sprite.sourceSizeHeight }}}, | |
"sourceSize": {"w":{{ sprite.sourceSizeWidth }},"h":{{ sprite.sourceSizeHeight }}}, | |
"spriteColorRect": {"x":{{ sprite.sourceColorRectX }},"y":{{ sprite.sourceColorRectY }},"w":{{ sprite.sourceColorRectWidth }},"h":{{ sprite.sourceColorRectHeight }}}, |
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 System.Runtime.CompilerServices; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.Events; | |
/// <summary> | |
/// Hierarchy Window Group Header | |
/// http://diegogiacomelli.com.br/unitytips-changing-the-style-of-the-hierarchy-window-group-header/ |
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; | |
using UnityEditor; | |
using DB = UnityEngine.Debug; | |
public class SelectWithLayer : ScriptableObject { | |
static void SelectLayer(int layerNum) { | |
var objs = Selection.GetFiltered(typeof(GameObject), SelectionMode.Deep); |
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
/* ************************************************************************** | |
Copyright 2012 Calvin Rien | |
(http://the.darktable.com) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.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
/* ************************************************************************** | |
Copyright 2012 Calvin Rien | |
(http://the.darktable.com) | |
Derived from a method in BuildManager, part of | |
VoxelBoy's Unite 2012 Advanced Editor Scripting Talk. | |
(http://bit.ly/EditorScripting) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. |
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.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
public class MaterialGradientDrawer : MaterialPropertyDrawer { | |
private int resolution; |
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; | |
namespace UnityEngine { | |
/// <summary> | |
/// Usage: | |
/// | |
/// (optional) Call GUIScaler.Initialize() in Start(), Awake() or OnEnable() (only needed once) | |
/// Call GUIScaler.Begin() at the top of your OnGUI() methods | |
/// Call GUIScaler.End() at the bottom of your OnGUI() methods |