Skip to content

Instantly share code, notes, and snippets.

View forestrf's full-sized avatar

Andrés Leone Gámez forestrf

View GitHub Profile
@LaneF
LaneF / DefineSymbolUtil.cs
Last active July 2, 2023 00:18
Unity Define Symbols Utility
using System.Text;
using UnityEditor;
using UnityEngine;
namespace Cleverous
{
public static class DefineSymbolUtil
{
public const string Symbol = "YOUR_DEFINE_SYMBOL";
@Fewes
Fewes / Tricubic.cginc
Last active May 7, 2024 07:16
Tricubic texture sampling using 8 trilinear samples
#ifndef TRICUBIC_INCLUDED
#define TRICUBIC_INCLUDED
float4 Cubic(float v)
{
float4 n = float4(1.0, 2.0, 3.0, 4.0) - v;
float4 s = n * n * n;
float x = s.x;
float y = s.y - 4.0 * s.x;
float z = s.z - 4.0 * s.y + 6.0 * s.x;
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active May 2, 2024 16:22
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@NovemberDev
NovemberDev / BehaviourTree.cs
Last active March 11, 2021 10:37
C# Behaviour Tree
using System;
using System.Linq;
using System.Collections.Generic;
public enum BehaviourTreeState
{
Success,
Failure,
Running
}
@andreiagmu
andreiagmu / FastPlatformSwitcher.cs
Last active December 14, 2022 14:47
Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions), for Asset Database v1
// Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions)
// For Asset Database v1
// by Andy Miira (Andrei Müller), October 2019
//
// Based on:
// Unity – fast build platform switcher script! (by Aymeric - Da Viking Code)
// https://davikingcode.com/blog/unity-fast-build-platform-switcher-script/
//
// A simple fast platform switcher for Unity (by Waldo Bronchart)
// https://gist.github.com/waldobronchart/b3cb789c028c199e2855
@roguesleipnir
roguesleipnir / ShaderOccurence.cs
Last active August 2, 2022 11:18
Material/Shader reference searcher. Find materials that use a shader by name string. Find materials with missing shader or errors. Original snippet from https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
//https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
public class ShaderOccurenceWindow : EditorWindow {
[MenuItem ("Tools/Shader Occurence")]
public static void Open () {
@LotteMakesStuff
LotteMakesStuff / LayoutUtils.cs
Last active November 2, 2023 21:04
Simple tool for importing editor layout files (.wlt files) from the asset folder. this is cool cos you can then share layouts with your team via source control
// put me in an Editor folder
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
public static class LayoutUtils
{
// unity stores layouts in a path referenced in WindowLayout.LayoutsPreferencesPath.
// Unfortunately, thats internal - well just creat the path in the same way they do!
@xiaoda
xiaoda / solve-git-problem
Last active November 16, 2022 17:49
Solve 'Auto packing the repository in background for optimum performance' Problem
git fsck --lost-found
git gc --prune=now
@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.
*