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 UnityEditor; | |
using System.IO; | |
using System.Text; | |
public class Utf8OnCreate : AssetModificationProcessor | |
{ | |
public static void OnWillCreateAsset(string assetPath) | |
{ | |
assetPath = assetPath.Replace(".meta", ""); |
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
public interface ISample | |
{ | |
void Do(); | |
} | |
public class SampleComponent : MonoBehaviour, ISample | |
{ | |
public void Do(){} | |
} |
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 UnityEditor; | |
using UnityEngine; | |
[Serializable] | |
public class InterfaceReference<T> where T : class | |
{ | |
[SerializeField] private UnityEngine.Object _object; | |
public T Value => _object as T; |
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> | |
/// Adds a dropdown to the Unity toolbar that lists all scenes from "Scenes In Build" and allows opening them directly from the editor. | |
/// Based on: https://github.com/Sammmte/unity-toolbar-extender-ui-toolkit | |
/// </summary> | |
using Paps.UnityToolbarExtenderUIToolkit; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
using UnityEngine; | |
using UnityEngine.UIElements; |
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.Threading; | |
using System.Threading.Tasks; | |
public class Timer | |
{ | |
private int _seconds; | |
private CancellationTokenSource _cts; | |
public Timer() |
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.Threading; | |
public class Timer | |
{ | |
private int _seconds; | |
private Timer _timer; | |
public Timer() | |
{ |
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; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ConsoleMenu consoleMenu = new(); |
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; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<string> cardRanks = new() | |
{ | |
"6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" |
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
Shader "Custom/DashedLineShader" | |
{ | |
Properties | |
{ | |
_MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Line Color", Color) = (1,1,1,1) | |
_Size ("Sprite Size", Range(0.01, 1)) = 0.1 | |
_DashedLineSize ("Dashed Line Size", Range(0.01, 10)) = 2.0 | |
_DashedLineSpacing ("Dashed Line Spacing", Range(0.01, 10)) = 2.0 | |
} |
NewerOlder