Skip to content

Instantly share code, notes, and snippets.

View lexnewgate's full-sized avatar
💭
I may be slow to respond.

lexnewgate lexnewgate

💭
I may be slow to respond.
  • Blackjack
  • Shanghai
View GitHub Profile
@munrocket
munrocket / wgsl_3d_sdf.md
Last active April 24, 2024 00:45
WGSL 3D SDF Primitives

WGSL 3D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/407

Sphere - exact

fn sdSphere(p: vec3f, r: f32) -> f32 {
  return length(p) - r;
}
@MaxWellHays
MaxWellHays / Heap.cs
Created October 27, 2020 19:17
C# Heap implementation
using System;
using System.Collections.Generic;
public class Heap<T>
{
List<T> a = new List<T>();
Comparer<T> comparer;
public Heap(Comparer<T> comparer)
{
@vanifatovvlad
vanifatovvlad / ScriptableObject Creator for Unity.md
Last active November 29, 2023 20:02
ScriptableObject Creator

ScriptableObject Creator for Unity

A handy little ScriptableObject creator which eliminates the need for those annoying [CreateAssetMenu] attributes which are a nightmare to maintain and navigate.

Made with Odin Inspector

ScriptablObject Creator

The ScriptableObject creator has been originally made by Bjarke. Published on Odin Community Made Tools.

Improvements by VladV:

@jasonboukheir
jasonboukheir / git
Last active March 29, 2024 18:12
git when in unix, git.exe when in wsl
#!/bin/sh
if pwd | grep /mnt/c > /dev/null; then
exec git.exe "$@"
else
exec /usr/bin/git "$@"
fi
@aholkner
aholkner / SerializedPropertyExtensions.cs
Last active July 17, 2023 13:58
Unity editor extension providing value get/set methods for SerializedProperty. This simplifies writing PropertyDrawers against non-trivial objects.
/* MIT License
Copyright (c) 2022 Alex Holkner
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
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Tamal
Tamal / git-ssh-error-fix.sh
Last active April 16, 2024 13:32
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@LotteMakesStuff
LotteMakesStuff / 1.md
Last active January 5, 2023 20:54
UPM: How to make a custom package

UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!


Todo

  • Modify the project manifest
  • Make a package manifest
  • Package the manifest up with some test code
  • Try it out in Unity!

@androidzhibinw
androidzhibinw / Unity-Profiler-Android.md
Last active November 8, 2023 01:43
Unity profiler for Android
  1. First you select development build for Android.(Build Settings-> Android -> check Develop Build box)

  2. Here is the guide from Unity doc: https://docs.unity3d.com/Manual/ProfilerWindow.html

  3. Before the 'adb forward' you should check the port(34999) first using: netstat -a -o -n | find "34999"

  4. Kill the process that alreay take the port "34999" using: taskkill /F /PID process_id

  5. adb forward --remove-all

@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active April 2, 2024 18:56
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;