Just download the script and put it in a "Editor" folder.
This file contains hidden or 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 UnityEngine.UI; | |
| public class HexGridLayout : LayoutGroup { | |
| const float SQUARE_ROOT_OF_3 = 1.73205f; | |
| public enum Axis { Horizontal = 0, Vertical = 1 } | |
| public enum Constraint { Flexible = 0, FixedColumnCount = 1, FixedRowCount = 2 } |
This file contains hidden or 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 |
This file contains hidden or 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.Reflection; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class SystemInfoInspector : EditorWindow { | |
| private static PropertyInfo[] properties; | |
| private static MethodInfo[] methods; | |
| private Vector2 scrollPosition; |
This file contains hidden or 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; | |
| public static class ActionExtensions { | |
| public static void SafeInvoke(this Action action) { | |
| if (action != null) { | |
| action(); | |
| } | |
| } |
This file contains hidden or 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.Linq; | |
| using UnityEditor; | |
| using UnityEditor.PackageManager.UI; | |
| using UnityEngine; | |
| using UnityEngine.Experimental.UIElements; | |
| using UnityEngine.Experimental.UIElements.StyleEnums; | |
| using PackageInfo = UnityEditor.PackageManager.PackageInfo; | |
| [InitializeOnLoad] | |
| public class PackageManagerExtentionExample : IPackageManagerExtension |
This file contains hidden or 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
| // threshold for mask can be controlled using vertex color alpha (useful for spriteRenderers or particle systems) | |
| // _MainTex: alpha of this texture is used as a mask | |
| // _EmissionTex: usually rgb noise texture, adjust it's scaling if needed | |
| // color remap and oscilation for each channel of emission can be modified in _EmStrobeBFALR, _EmStrobeBFALG, _EmStrobeBFALB | |
| // Base: base amplitude of brightness oscilation | |
| // Freq: frequency of oscilation | |
| // Ampl: amplitude of oscilation | |
| // L: how much _EmissionTex affects this color | |
| Shader "StandardWMask" { |
This file contains hidden or 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; | |
| using System.Diagnostics; | |
| public class CreateSymlinkProject { | |
| [MenuItem("Utils/Create Symlink Project")] | |
| static void DoIt() | |
| { | |
| string folderName = EditorUtility.SaveFolderPanel("Symlink Project Location", "", ""); |
UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!
Todo
- Modify the project manifest
- Make a package manifest
- Package the manifest up with some test code
- Try it out in Unity!
This file contains hidden or 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 UnityEngine; | |
| namespace GameEvents { | |
| [CreateAssetMenu(menuName = "Game Events/GameEvent")] | |
| public class GameEvent : ScriptableObject { | |
| private readonly List<GameEventListener> eventListeners = new List<GameEventListener>(); |