Skip to content

Instantly share code, notes, and snippets.

View hasanbayatme's full-sized avatar
❤️
Perceiving Love

Hasan Bayat hasanbayatme

❤️
Perceiving Love
View GitHub Profile
@hasanbayatme
hasanbayatme / README.md
Last active January 15, 2024 06:59
A Scene Switcher Utility Window for Unity

Scene Switcher

A Scene Switcher Utility Window for Unity, Switch between Scenes Effortlessly.

Inspired by Kenney sceneWindow.cs

Deprecation Notice

This gist is deprecated due to release of this utility on Asset Store, you can now get the latest version of this utility from Asset Store, but it is available here as is without any updates.

@hasanbayatme
hasanbayatme / README.md
Last active January 22, 2024 10:25
A Scene Manager Utility Window for Unity

Scene Manager

A Scene Manager utility window for Unity.

Inspired by Kenney sceneWindow.cs

Deprecation Notice

This gist is deprecated due to release of this utility on Asset Store, you can now get the latest version of this utility from Asset Store, but it is available here as is without any updates.

using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections.Generic;
using System.IO;
// Scene selection
@hasanbayatme
hasanbayatme / ColorPickerWindow.cs
Last active October 24, 2018 10:32
A Color Picker Window for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class ColorPickerWindow : EditorWindow
{
protected Color color = Color.white;
protected Color32 color32 = new Color32 ( 255, 255, 255, 255 );
@LotteMakesStuff
LotteMakesStuff / EditorDispatcher.cs
Last active February 13, 2024 13:22
Allows threaded Unity Editor code to dispatch an action or coroutine to the main thread.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
public static class EditorDispatcher
{
private static readonly Queue<Action> dispatchQueue = new Queue<Action>();
@hasanbayatme
hasanbayatme / Singleton.cs
Last active March 5, 2023 19:06
Best Singleton implementation in Unity, Combine it with preload scene pattern to achieve best implementation.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Singleton<T> : MonoBehaviour where T : Component
{
#region Fields
/// <summary>
@hasanbayatme
hasanbayatme / DrawLine.cs
Last active August 8, 2024 22:48
Unity (Game Engine) Line Drawing with mouse using Line Renderer. Useful for painting, drawing 2d physics lines.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawLine : MonoBehaviour
{
[SerializeField]
protected LineRenderer m_LineRenderer;
[SerializeField]
@hasanbayatme
hasanbayatme / README.md
Last active December 28, 2020 00:14
A Simple Bash Script for Installing Composer on Ubuntu Locally (current user) and Globally (all users).

Installation

Install composer locally (current user only):

wget -O - https://gist.github.com/EmpireWorld/1dd5f59566e186907f99dc16badc382a/raw/install-composer-local.sh | bash

Install composer globally (all users):

@hasanbayatme
hasanbayatme / README.md
Last active December 23, 2023 20:14
Easy to use Bash Script to Install LAMP stack on Ubuntu.

Installation

Automatic

Run the below command in terminal:

wget --no-cache -O - https://gist.github.com/EmpireWorld/737fbb9f403d4dd66dee1364d866ba7e/raw/install-lamp.sh | bash
@FaizanDurrani
FaizanDurrani / SceneProjectView.cs
Created May 31, 2017 17:11
Creates a new editor window to list all the scenes in your project, Improves workflow if you have a ton of directories and scenes.
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
public class SceneProjectView : EditorWindow {
private GUIStyle alternateColor;
private Texture2D tex;
[MenuItem("Window/Scene Project View")]
public static void Init()