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 / AnimatorUtility.cs
Last active March 16, 2024 18:55
Unity animator utilities such as checking if the animator has parameter or safely setting the animator parameters.
/**
MIT License
Copyright (c) 2023 Bayat Games
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@hasanbayatme
hasanbayatme / GlobalVariables.cs
Last active November 17, 2023 09:14
A simple C# static class to get and set globally accessible variables through a key-value approach (C#, Unity, .NET)
using System.Collections.Generic;
/// <summary>
/// A simple static class to get and set globally accessible variables through a key-value approach.
/// </summary>
/// <remarks>
/// <para>Uses a key-value approach (dictionary) for storing and modifying variables.</para>
/// <para>It also uses a lock to ensure consistency between the threads.</para>
/// </remarks>
public static class GlobalVariables
@hasanbayatme
hasanbayatme / ExtraEditorGUILayout.cs
Created July 14, 2019 05:00
Extra Editor GUI Layouot Methods for drawing GUI, such as ReadonlyTextArea, ReadonlyTextField and more.
using UnityEngine;
using UnityEditor;
public static class ExtraEditorGUILayout
{
public static void ReadonlyTextArea(string text, params GUILayoutOption[] options)
{
EditorGUILayout.SelectableLabel(text, EditorStyles.textArea, options);
}
@hasanbayatme
hasanbayatme / ImageLoader.cs
Last active October 10, 2018 11:33 — forked from maxoja/ImageLoader.cs
Unity How to : Load Image from WebLink or URL
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ImageLoader : MonoBehaviour
{
public string url = "https://i.pinimg.com/originals/9e/1d/d6/9e1dd6458c89b03c506b384f537423d9.jpg";
public RawImage rawImage;
@hasanbayatme
hasanbayatme / MinMax.cs
Last active November 23, 2020 16:00
Unity Min Max Slider Implementation
using System;
using UnityEngine;
[Serializable]
public struct MinMax
{
[SerializeField]
private float min;
[SerializeField]
@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.

@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 );
@hasanbayatme
hasanbayatme / Blockstack.md
Created December 22, 2017 16:06
Blockstack Verification

Keybase proof

I hereby claim:

  • I am empireworld on github.
  • I am hasanbayat (https://keybase.io/hasanbayat) on keybase.
  • I have a public key whose fingerprint is EBEE C46A 4B0F D8C6 4FF4 1B46 9A63 B2B3 2011 4989

To claim this, I am signing this object: