Skip to content

Instantly share code, notes, and snippets.

View InternalSington.txt
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>
View UnderstandingUnity.cs
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 Mar 10, 2019
All that I've got so far.
View Enums.cs
public enum PartTypes
{
Disabled,
ShipArmor,
BeamGenerator,
BeamCharger,
EnergyShield,
ShieldGenerator,
MissileMagazine,
Specials,
@ZeredaGames
ZeredaGames / Singleton.cs
Last active Mar 8, 2019
How i have it set up thus far.
View Singleton.cs
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 Mar 12, 2019
This is just some examples i found of how to use attribute to clean up the inspector and also make it more user friendly.
View MyClass.cs
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 Mar 7, 2019
Building Upon the Playfab examples and the tutorials by InfoGamers.
View AppQuit.cs
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 Mar 3, 2019
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
View Enums.cs
namespace ZeredaGamesEngine.Core.Libraries.Games.Pokemon
{
#region Pokemon
/// <summary>
/// Pokemon Enums.
/// </summary>
[System.Serializable]
public enum PokemonPerminantBoosts
{
View 79-C# Script-CreateAssetMenuScript.cs.txt
#region using
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
#endregion
#region Script
View 78-C# Script-NewBehaviourScriptAdvanced.cs.txt
#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)
View 80-C# Script-NewBehaviourScript.cs.txt
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class #SCRIPTNAME# : MonoBehaviour {
public static #SCRIPTNAME# instance = null;
public #SCRIPTNAME# GetInstance (){
instance = this;