Skip to content

Instantly share code, notes, and snippets.

void Awake(){
AwakeSingleton();
}
#region Internal Singleton
[Header("Internal Singleton:"), Tooltip("If True: this becomes a singleton.")]
public bool SetDontDestroyOnLoad = true;
public bool DebugMode = true;
/// <summary>
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagment;
using System.Collection;
using System.Collection.Generic;
namespace ZG
{
//[MenuItem ("testingPhase/${FileName} ")]
public class ${FileName} : MonoBehaviour
{
@ZeredaGames
ZeredaGames / Enums.cs
Last active March 10, 2019 17:51
All that I've got so far.
public enum PartTypes
{
Disabled,
ShipArmor,
BeamGenerator,
BeamCharger,
EnergyShield,
ShieldGenerator,
MissileMagazine,
Specials,
@ZeredaGames
ZeredaGames / Singleton.cs
Last active March 8, 2019 14:57
How i have it set up thus far.
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{
private static T _instance;
private static object _lock = new object();
public static T Instance
{
@ZeredaGames
ZeredaGames / MyClass.cs
Last active March 12, 2019 10:27
This is just some examples i found of how to use attribute to clean up the inspector and also make it more user friendly.
using UnityEngine;
[HelpURL("http://unity3d.college")]
[SelectionBase]
public class MyClass : MonoBehaviour
{
[Header("Text Attributes"), TextArea, Tooltip("A string using the TextArea attribute"), SerializeField]
private string
descriptionTextArea;
@ZeredaGames
ZeredaGames / AppQuit.cs
Last active March 7, 2019 18:58
Building Upon the Playfab examples and the tutorials by InfoGamers.
using UnityEngine;
using System.Collections;
public class AppQuit : MonoBehaviour, IQuittable {
public void OnQuit() {
Debug.Log ("AppQuit.Quit");
Application.Quit ();
}
}
@ZeredaGames
ZeredaGames / Enums.cs
Last active May 12, 2023 18:34
I've coded out the base of all the pokemon moves. Do require sounds and sprites. Code not 100% complete but its getting close. Is a work in progress
namespace ZeredaGamesEngine.Core.Libraries.Games.Pokemon
{
#region Pokemon
/// <summary>
/// Pokemon Enums.
/// </summary>
[System.Serializable]
public enum PokemonPerminantBoosts
{
#region using
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
#endregion
#region Script
#region Licencing
/*
ZeredaGamesEngine
Author:
Zereda Games
Thamas Bell : thamasbell@hotmail.com (Depricated, but have ownership - Locked out.)
thamasbell@gmail.com (Personal email A)
thamasabell@gmail.com (Personal email B)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class #SCRIPTNAME# : MonoBehaviour {
public static #SCRIPTNAME# instance = null;
public #SCRIPTNAME# GetInstance (){
instance = this;