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 CommandLine; | |
| using CommandLine.Text; | |
| using System.Reflection; | |
| /// <summary> | |
| /// A CLI command of the application, like <i>clone</i> in <i>git clone</i>. | |
| /// Corresponds to a verb in the CommandLineParser. | |
| /// </summary> | |
| /// <remarks> | |
| /// Derived types are created by the CommandLineParser and their Run method is called when parsing was successful. |
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; | |
| using System.Collections.Generic; | |
| public class Program | |
| { | |
| public static void Main() | |
| { | |
| // Will allocate. | |
| IList list = new List<int>(); | |
| foreach (var item in list) |
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
| private void OnPresetSelected(object userdata) | |
| { | |
| // We want to quickly define some string collections as "presets". | |
| foreach (var preset in presetsOld) | |
| { | |
| foreach (var prop in preset) | |
| Debug.Log(prop); | |
| } | |
| // But it's much nicer if each collection has a name. |
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
| /// <summary> | |
| /// Creates beings imbued with magical powers. | |
| /// </summary> | |
| public class WizardFactory | |
| { | |
| public Wizard Create() | |
| { | |
| // Just imagine this as part of some editor interface | |
| // or default values that are hardcoded for any reason. | |
| return new Wizard |
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 System.IO; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| using UnityEngine.UI; | |
| public static class ExportBuiltinUISprites | |
| { | |
| private const string outputDirectory = "Assets/Graphics/"; |
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 DG.Tweening; | |
| using Nementic.Exit; | |
| using UnityEngine; | |
| public class VirtualDelegateInvocation : MonoBehaviour | |
| { | |
| private Child p = new Child(); | |
| [EditorButton()] |
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; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class CircleMath : MonoBehaviour | |
| { | |
| public Vector3 position = Vector3.right; | |
| public float angleStart = 20; | |
| public float angleEnd = 270; | |
| public float duration = 1f; |
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 UnityEditor; | |
| using UnityEngine; | |
| /// <summary> | |
| /// Demonstrates how to use <see cref="UnityEditor.PreviewRenderUtility"/> | |
| /// to render a small interactive scene in a custom editor window. | |
| /// </summary> | |
| public class CustomPreviewExample : EditorWindow | |
| { | |
| [MenuItem("My Tools/Custom Preview")] |
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
| #if UNITY_EDITOR | |
| using System.IO; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class ImageGenerator : ScriptableWizard | |
| { | |
| [MenuItem("Nementic/Utility/Image Generator...")] | |
| public static void CreateWizard() | |
| { |