Skip to content

Instantly share code, notes, and snippets.

View mikerochip's full-sized avatar

Mike Schweitzer mikerochip

View GitHub Profile
@mikerochip
mikerochip / SerializedPropertyExtensions.cs
Last active May 10, 2024 01:59
Unity SerializedProperty extensions and utilities
using System;
using System.Collections;
using UnityEditor;
namespace MikeSchweitzer
{
public static class SerializedPropertyExtensions
{
public static T[] GetAllValues<T>(this SerializedProperty property)
{
@mikerochip
mikerochip / PluginSuppressor.cs
Last active November 5, 2023 23:09
Unity Editor code to suppress annoying issues with commonly-used plugins
using HutongGames.PlayMakerEditor;
using UnityEditor;
namespace OrgName.ProjectName.Unity.Editor.AnnoyingStuff
{
public class PluginSuppressor : AssetPostprocessor
{
[InitializeOnLoadMethod]
private static void Initialize()
{
@mikerochip
mikerochip / .dockerignore
Last active March 19, 2023 22:34
ASP.NET 7 Docker
# directories
**/bin/
**/obj/
**/out/
# files
Dockerfile*
**/*.md
@mikerochip
mikerochip / LeanContractResolver.cs
Last active November 5, 2023 23:08
Json.NET boilerplate to ignore serializing empty values and "read only" properties
public class LeanContractResolver : DefaultContractResolver
{
public static LeanContractResolver Instance { get; } = new();
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
var property = base.CreateProperty(member, memberSerialization);
if (property.PropertyType == null)
return property;
@mikerochip
mikerochip / MikesAddressablesTrainingManual.md
Last active May 23, 2021 17:16
Mike's Addressables Training Manual