Skip to content

Instantly share code, notes, and snippets.

View jackyyang09's full-sized avatar

Brogrammist jackyyang09

View GitHub Profile
@jackyyang09
jackyyang09 / TF2PaintedShader.shader
Last active October 21, 2022 17:34
TF2 shader for Unity that also "paints" hats by blending tint colors to a texture's alpha channel. Alternative version of an existing TF2 shading implementation
// Alternative version of an existing TF2 shading implementation that applies tints to a texture's alpha channel
// Allows for adding "paint" to hats that support the feature
// $blendtintbybasealpha is always assumed to be 1 for performance purposes. Do use the original shader for unpainted items
// Original: https://forum.unity.com/threads/team-fortress-2-toon-shader-in-unity-free-version.93194/
Shader "Toon/Team Fortress 2 - Painted" {
Properties{
_Paint("Paint", Color) = (1, 1, 1, 1)
_RimColor("Rim Color", Color) = (0.97,0.88,1,0.75)
_RimPower("Rim Power", Float) = 2.5
_MainTex("Diffuse (RGB) Alpha (A)", 2D) = "white" {}
@jackyyang09
jackyyang09 / PositionListTool.cs
Last active February 20, 2023 16:22
Ever wanted a list of Vector3s easily accessible through Unity's inspector window?
using System.Collections.Generic;
using UnityEngine;
public class PositionListTool : MonoBehaviour
{
[SerializeField]
List<Vector3> positions = new List<Vector3>();
public List<Vector3> GetPositions()
{
@jackyyang09
jackyyang09 / CreateEmptyAtRoot.cs
Last active March 3, 2020 21:26
A somewhat extended version of a gist uploaded by user gekidoslair that adds two new lines of code. New code selects the new object created and adds the creation of the object to the undo stack
using UnityEditor;
using UnityEngine;
namespace MWU.Shared.Utilities
{
/// <summary>
/// Adds 'Create Empty at Root' shortcut for the GameObject / right-click context menu to create an empty gameobject at 0,0,0
/// Original can be found here: https://gist.github.com/gekidoslair/359535dd108ce3dfac6b564ad37e42fe
/// </summary>
public class CreateEmptyAtRoot : MonoBehaviour