This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DEBUG_CC2D_RAYS | |
using UnityEngine; | |
using System; | |
using System.Collections.Generic; | |
// ReSharper disable All | |
namespace Prime31 | |
{ | |
[RequireComponent(typeof(BoxCollider2D), typeof(Rigidbody2D))] | |
public sealed class CharacterController2D : MonoBehaviour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DEBUG_CC2D_RAYS | |
using UnityEngine; | |
using System; | |
using System.Collections.Generic; | |
// ReSharper disable All | |
namespace Prime31 | |
{ | |
[RequireComponent(typeof(BoxCollider2D), typeof(Rigidbody2D))] | |
public sealed class CharacterController2D : MonoBehaviour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gdnative | |
import _c "core:c" | |
Int :: _c.int; | |
Real :: _c.float; | |
Bool :: _c.bool; | |
Object :: rawptr; | |
ClassConstructor :: #type proc "c" () -> rawptr; | |
GdnativeInitFn :: #type proc "c" (unamed0 : ^GdnativeInitOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
odin build test.odin -file -build-mode:shared -out:libtest.so || exit $?; | |
$1 -Wall -Werror -o test_dlopen main.c || exit $?; | |
$1 -Wall -Werror -o test_linked main.c -ltest -L. -DTEST_LINKED || exit $?; | |
printf '\n[mode: dlopen]\n' | |
LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} ./test_dlopen || exit $?; | |
printf '\n[mode: linked]\n' | |
LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} ./test_linked || exit $?; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BetterSimpleStateMachine<TEnum> : Component, IUpdatable | |
where TEnum : struct, IComparable, IFormattable | |
{ | |
class StateMethodCache | |
{ | |
public Action EnterState; | |
public Func<TEnum> Tick; | |
public Action ExitState; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows 10 x64 | |
Radeon 1500x (8 CPUs) ~3.5 GHz | |
./main.exe | |
[1M Iterations Internal Lerp] 1000000 rounds in 28827000 ns | |
34689700.628 rounds/s | |
[100M Iterations Internal Lerp] 100000000 rounds in 2900400700 ns | |
34477994.713 rounds/s | |
[1M Iterations Custom Lerp] 1000000 rounds in 21413900 ns | |
46698639.669 rounds/s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TaskExtensions | |
{ | |
public static Task OnSuccess(this Task task, Action<Task> success) | |
{ | |
_ = task.ContinueWith(success, TaskContinuationOptions.OnlyOnRanToCompletion); | |
return task; | |
} | |
public static Task OnError(this Task task, Action<Task> error) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Start Minimal GC Styling*/ | |
.controller.custom { | |
background: url(https://imgur.com/CdyFFZZ.png); | |
height: 441px; | |
width: 981px; | |
} | |
.custom .bumpers{ | |
position: absolute; | |
height: 100px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public record User(int Id, string Username); | |
// might have some state, doesnt necessarily need any though | |
public record UserController(); | |
public static class UserControllerExt { | |
public static void DoComplexActionAgainstUser( | |
this UserController uc, | |
IUserConn conn, | |
int id) { |
NewerOlder