GUIStyle mystyle = new GUIStyle("some string from the list below");
- "CN Box"
- "Button"
| using UnityEngine; | |
| using System.Collections; | |
| using System; | |
| //based on the code in this post: http://martinecker.com/martincodes/unity-editor-window-zooming/ | |
| //but I changed how the API works and made it much more flexible | |
| //usage: create an EditorZoomer instance wherever you want to use it (it tracks the pan + zoom state) | |
| //in your OnGUI, draw your scrollable content between zoomer.Begin() and zoomer.End(); | |
| //you also must offset your content by zoomer.GetContentOffset(); |
| using UnityEngine; | |
| // Helper Rect extension methods | |
| public static class RectExtensions | |
| { | |
| public static Vector2 TopLeft(this Rect rect) | |
| { | |
| return new Vector2(rect.xMin, rect.yMin); | |
| } |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| public class FieldOfView : MonoBehaviour { | |
| public float viewRadius; | |
| [Range(0, 360)] | |
| public float viewAngle; |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System; | |
| using System.Reflection; | |
| public class SelectPrefabsOfType : EditorWindow { | |
| [MenuItem("Window/Prefab Finder")] |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |