Skip to content

Instantly share code, notes, and snippets.

View SugoiDev's full-sized avatar
🎯
Focusing

SugoiDev

🎯
Focusing
View GitHub Profile
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@ZimM-LostPolygon
ZimM-LostPolygon / UnityGuidRegenerator.cs
Last active June 3, 2024 07:38
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 31, 2024 12:55
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

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
@cobbpg
cobbpg / Unity-hotswapping-notes.md
Last active June 2, 2024 18:10
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping

@mattatz
mattatz / LabColorspace.cginc
Created November 25, 2015 05:35
Conversion between RGB and LAB colorspace shader for Unity.
#ifndef __LAB_COLORSPACE__
#define __LAB_COLORSPACE__
/*
* Conversion between RGB and LAB colorspace.
* Import from flowabs glsl program : https://code.google.com/p/flowabs/source/browse/glsl/?r=f36cbdcf7790a28d90f09e2cf89ec9a64911f138
*/
float3 rgb2xyz( float3 c ) {
float3 tmp;
@maxmcguire
maxmcguire / ReorderComponents.cs
Last active July 10, 2023 11:41
A small utility to reorder components with drag and drop in Unity
/**
The MIT License (MIT)
Copyright (c) 2015, Max McGuire
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:
@mlocati
mlocati / win10colors.cmd
Last active June 16, 2024 17:49
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@oxysoft
oxysoft / GetPointClosestTo.cs
Last active March 13, 2021 00:15
Optimized algorithm I made which finds the closest point on a bezier spline to another arbitrary P point
public Vector3 GetPointClosestTo(Vector3 p, out float result, out int curve) {
// an optimized algorithm i invented which finds the closest point on a bezier to another arbitrary P point
// this algorithm is iteration based, meaning that the more iterations your perform, the more precise the results will be
// it is optimized to be fast but this particular implemention is not necessarily as fast as it could be, and the code is certainly not pretty
// optimizing this is left as an exercise to the viewer
// points is a vector3 array which defines the anchors and control points of the current bezier curve in the following format
// [anchor, control, control] * n, [anchor]
// where n is as many bezier curves which this spline defines. it pieces multiple bezier curves together, although the algorithm could be adapted for single curves that are alone
@Seneral
Seneral / GUIScaleUtility.cs
Last active May 5, 2023 05:46
Advanced GUI scaling for Unity. Fixes problems with unscaled clipping rect using reflection. Allows for custom zoom positions other than (0,0). Need all elements to offset by a specified value to account for zoom position and scale though. Example of use is my open source Node Editor Framework
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
namespace NodeEditorFramework.Utilities
{
public static class GUIScaleUtility