Skip to content

Instantly share code, notes, and snippets.

View abirpahlwan's full-sized avatar

Pahlwan Rabiul Abir abirpahlwan

View GitHub Profile
@abirpahlwan
abirpahlwan / PlayerPrefsExtra.cs
Created October 27, 2022 22:56
PlayerPrefsExtra gives you more possibilities like saving complex types
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// PlayerPrefsExtra gives you more possibilities like saving complex types
/// Vectors, Colors, Quaternions, Lists and Your Pre defined types (Objects, Classes or Structs).
///
/// Developed by Hamza Herbou
/// Email : hamza95herbou@gmail.com
/// GitHub : https://github.com/herbou/
@abirpahlwan
abirpahlwan / Singleton.cs
Created October 2, 2022 23:21
Unity Singleton
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour {
// Check to see if we're about to be destroyed.
private static bool _ShuttingDown = false;
private static object _Lock = new object();
private static T _Instance;
/// <summary>
/// Access singleton instance through this propriety.