Skip to content

Instantly share code, notes, and snippets.

View AleshaCoder's full-sized avatar
🎮
Make games

Aleksey Afanasyev AleshaCoder

🎮
Make games
  • DSpaceNN
View GitHub Profile
public interface ISample
{
void Do();
}
public class SampleComponent : MonoBehaviour, ISample
{
public void Do(){}
}
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;
/// <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;
/// <summary>
/// Adds a button to the Unity toolbar that launches the first scene listed in "Scenes In Build".
/// 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;
using System;
using System.Threading;
using System.Threading.Tasks;
public class Timer
{
private int _seconds;
private CancellationTokenSource _cts;
public Timer()
using System;
using System.Threading;
public class Timer
{
private int _seconds;
private Timer _timer;
public Timer()
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
class Program
{
static void Main(string[] args)
{
ConsoleMenu consoleMenu = new();
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"
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
}
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
public class LevelEditor : EditorWindow
{
private List<Level> _levels = new List<Level>(); // Список уровней
private LevelCollection _collection; // Общая коллекция
[MenuItem("Custom/Level Editor")]