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; | |
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(); |
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
// DONT PUT IN EDITOR FOLDER | |
using System; | |
using UnityEngine; | |
/// <summary> | |
/// Attribute used to show or hide the Field depending on certain conditions | |
/// </summary> | |
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] | |
public class ShowWhenAttribute : PropertyAttribute { |