Skip to content

Instantly share code, notes, and snippets.

View cathei's full-sized avatar

Maxwell Keonwoo Kang cathei

View GitHub Profile
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
[MemoryDiagnoser]
public unsafe class UnsafeArray
{
private const int Count = 100_000_000;
private int* arrayPtr;
@cathei
cathei / ModelExample.cs
Created December 21, 2022 03:25
Sample of using reactive model instead of direct references
public class PlayerModel
{
public ReactiveProperty<int> Score { get; } = new();
}
public class GameModel
{
public ReactiveCollection<PlayerModel> Players { get; } = new();
}
@cathei
cathei / StringEnum.cs
Created September 12, 2022 01:43
Unity String Enum Serialization (Supports from Unity 2020.1)
// StringEnum, Maxwell Keonwoo Kang <code.athei@gmail.com>, 2022
using System;
using UnityEngine;
namespace StringEnum
{
[Serializable]
public struct StringEnum<T> : IEquatable<T>, IEquatable<StringEnum<T>>, ISerializationCallbackReceiver
where T : struct, Enum
@cathei
cathei / Example.cs
Last active September 4, 2022 19:16
Example of interface application to Trigger/Effect system
using System.Collections.Generic;
using UnityEngine;
// this is for void events, other events will also implement this
public interface IEventParam { }
// sample event param
public interface IPositionalEventParam : IEventParam
{
Vector3 Position { get; }
@cathei
cathei / cert-manager-kustomization
Last active April 9, 2022 18:29
Installing Jaeger on Autopilot GKE
resources:
- https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
patchesJson6902:
# https://github.com/cert-manager/cert-manager/issues/3338
# https://github.com/cert-manager/cert-manager/issues/3717
# Credit to @lnhrdt on comment
- target:
group: rbac.authorization.k8s.io
version: v1