Skip to content

Instantly share code, notes, and snippets.

View aprius's full-sized avatar
:shipit:
ops

Aprius aprius

:shipit:
ops
View GitHub Profile
@aprius
aprius / Util.cs
Last active August 3, 2020 15:39
Utility for unity
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Worldreaver.Utility
{
/// <summary>
/// utility
/// </summary>
@aprius
aprius / DBViewer.cs
Last active September 22, 2019 15:43
DB viewer for message pack
#if UNITY_EDITOR
using MessagePack.Resolvers;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Database;
using UnityEditor;
using UnityEngine;
@aprius
aprius / EasingFunctions.cs
Last active October 13, 2019 10:57 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
-r:System.IO.Compression.dll
-r:System.IO.Compression.FileSystem.dll
@aprius
aprius / NativeMeshTest.cs
Created November 2, 2019 11:31 — forked from LotteMakesStuff/NativeMeshTest.cs
[NativeCollections] How to copy a regular .C# array into a NativeArray suuuuuper quick using memcpy. its about as fast as its ever gunna get!
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using UnityEngine;
public class NativeMeshTest : MonoBehaviour
{
private NativeArray<float3> vertexBuffer;
private Vector3[] vertexArray;
@aprius
aprius / RandomFaster.cs
Created November 13, 2019 10:47
A fast random number generator for .NET and Unity
using System;
// ReSharper disable UnusedMember.Global
// ReSharper disable once CheckNamespace
namespace UnityModule.RandomFaster
{
/// <summary>
/// A fast random number generator for .NET
/// Colin Green, January 2005
///
@aprius
aprius / config.yaml
Last active November 27, 2019 19:09
verdaccio config
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: ./storage
"scopedRegistries": [
{
"name": "com.yenmoc",
"url": "http://localhost:4873",
"scopes": [
"com.yenmoc"
]
}
],
@aprius
aprius / Brenchmark serialize with unity .md
Created February 4, 2020 07:01
FlatBuffer vs MessagePack-Csharp vs JsonUtility

Brenchmark

  • Serialize and Deserialize array 2000 item
Type Size Deserialize Deserialize GC Serialize Serialize GC
FlatBuffer binary 2.846 0.0528 0.2485 0.2745 0.7279
MessagePack-Csharp binary 1.000 1.0000 1.0000 1.0000 1.0000
JsonUtility text 2.657 0.0793 0.6279 0.0341 0.3851
  • Searching item MemoryMaster is faster than FlatBuffer
@aprius
aprius / semantic versioning
Created March 1, 2020 09:05
semantic versioning
https://semver.org
[major].[minor].[patch]-[pre-release]
# Examples
1.0.0
1.0.1-preview
1.0.2-preview.1
Major increases when the API breaks backward compatibility.