Skip to content

Instantly share code, notes, and snippets.

View firenz's full-sized avatar
🏠
Working at home

Alicia firenz

🏠
Working at home
View GitHub Profile
@SeventySevian
SeventySevian / gist:3977847
Created October 30, 2012 01:49
Unity Pixelated shader
Shader "Seventy Sevian/Pixelated"
{
Properties
{
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
_PixelCountU ("Pixel Count U", float) = 100
_PixelCountV ("Pixel Count V", float) = 100
}
Shader "Sprites/Cutout"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.5
}

Git Cheat Sheet

Commands

Getting Started

git init

or

@rveitch
rveitch / sass-7-1-pattern.scss
Last active May 12, 2024 21:18
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@Ikalou
Ikalou / git_and_unity.md
Last active April 22, 2024 04:01
Git and Unity

EDIT: this is an old post and a lof the information in this document is outdated.

Using Git with Unity

Git logo

Git is a popular free and open source distributed version control system.

I am new to Unity, but as a long time git user, I wanted to use git for my

@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@beepdavid
beepdavid / gist:b72f7494f84bd52f82c12beedaaf2c72
Last active January 14, 2017 18:39
Dynamic mesh triangulation of curved path shapes
Very quick overview of how this works: https://twitter.com/beepdavid/status/814869295524155392
1) Custom path tool that supports line, quad and bezier sections
2) On path change, create a polygon (Vector3 array) by sampling points along the path
3) Curves are sampled evenly by estimating the curve length first, then sampling at the required curve resolution
4) Feed polygon into https://triangle.codeplex.com/ to get triangle data (this needs some work to use in Unity)
5) Create procedural mesh using output triangle data
6) Profit!
Any questions, comment or tweet me @beepdavid :)
@LotteMakesStuff
LotteMakesStuff / CustomInspectorCreator.cs
Last active May 16, 2024 07:08
Editor extension that adds a tool to automagically generate boilerplate custom inspector code~ YES! Just drop it into a folder called 'Editor' and it adds a 'custom inspector' option into the Project window!
using UnityEngine;
using UnityEditor;
using System.IO;
public static class CustomInspectorCreator
{
[MenuItem("Assets/Create/Custom Inspector", priority = 81)]
static void CreateInsptorEditorClass()
{
foreach (var script in Selection.objects)
@LotteMakesStuff
LotteMakesStuff / ReadOnlyAttribute.cs
Created January 17, 2017 00:17
ReadOnly property drawer for Unity~ Add a [ReadOnly] attribute to a property to make it show up as read only in the inspector
// NOTE DONT put in an editor folder
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute { }
@LotteMakesStuff
LotteMakesStuff / StatsBarAttribute.cs
Last active March 24, 2023 16:37
StatsBar property drawer for Unity~ Add a [StatsBar] attribute to a property to make it draw a lil bar, really useful for visualizing character stats like Health or Mana.
// NOTE DONT put in an editor folder
using UnityEngine;
public class StatsBarAttribute : PropertyAttribute
{
public string valueMax;
public StatsBarColor color;
public StatsBarAttribute(string valueMax = null, StatsBarColor color = StatsBarColor.Red)