Skip to content

Instantly share code, notes, and snippets.

View rickyah's full-sized avatar

Ricardo Amores Hernández rickyah

  • Barcelona
  • 00:25 (UTC +02:00)
  • X @rickyah
View GitHub Profile
@rickyah
rickyah / dotnet-format-action.yml
Created July 25, 2020 08:24
Runs dotnet-format on every PR and create a commit that fixes the formatting if it doesn't comply with your code convention
name: Format check on pull request
on: pull_request
jobs:
dotnet-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2.2.0
with:
fetch-depth: 0
@rickyah
rickyah / MonoBehaviourSingleton.cs
Created June 3, 2015 08:59
MonoBehaviour Singleton
using System;
using UnityEngine;
/// <summary>
/// This is a generic Singleton implementation for Monobehaviours.
/// Create a derived class where the type T is the script you want to "Singletonize"
/// Upon loading it will call DontDestroyOnLoad on the gameobject where this script is contained
/// so it persists upon scene changes.
/// </summary>
/// <remarks>