Skip to content

Instantly share code, notes, and snippets.

View gakkossphynx's full-sized avatar
💯
Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work

SPHYNX gakkossphynx

💯
Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work
  • TR
View GitHub Profile
using System;
using System.IO;
using System.Reflection;
using System.Text;
using Unity.Entities;
using UnityEditor;
/// <summary>
/// will create a new authring script based on an IComponentData
/// </summary>
@xabblll
xabblll / MeshPostprocessor.cs
Created June 15, 2024 21:24
Unity3D - Model postprocessor for fixing blend shapes normals and tangents
// Place inside Editor folder
using UnityEditor;
using UnityEngine;
namespace Code.Editor
{
public class MeshPostprocessor : AssetPostprocessor
{
private void OnPostprocessModel(GameObject g)
@yasirkula
yasirkula / SceneViewUIObjectPickerContextWindow.cs
Last active July 19, 2024 23:42
Select the UI object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
@pazzaar
pazzaar / AnimatorExtensions
Last active April 6, 2024 06:02
Animator rebind function that also maintains some state
using System.Collections.Generic;
using UnityEngine;
public static class AnimatorExtensions
{
public static void RebindAndRetainState(this Animator anim)
{
List<AnimatorStateInfo> animStates = new List<AnimatorStateInfo>();
for (int i = 0; i < anim.layerCount; i++)
{
@pazzaar
pazzaar / gist:17ab22412c7045fba2e002405d6d6cdd
Created September 4, 2021 09:19
Unity mesh info including LOD levels
using UnityEngine;
using System.Collections;
using UnityEditor;
public class MeshInfo : EditorWindow
{
bool showLOD1info = false;
bool showLOD2info = false;
bool showLOD3info = false;
bool showLOD4info = false;
@totallyRonja
totallyRonja / MaterialGradientDrawer.cs
Last active September 26, 2023 09:46
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private int resolution;
@andrew-raphael-lukasik
andrew-raphael-lukasik / .TextureColorFillCalculator.cs.md
Last active September 28, 2023 18:52
Texture Color Fill Calculator

test1 test2 test3 test4

@unitycoder
unitycoder / gist:199ff1dfd521bd9e9ae1e70e44e6bc5d
Last active September 25, 2021 08:14
[Fixefox GreaseMonkey Plugin Script] Fix Old Asset Store Links
// ==UserScript==
// @name Fix Old Asset Store Links
// @version 1
// @include https://www.assetstore.unity3d.com/*
// @grant none
// ==/UserScript==
// get current url
var URL = window.location.href;
@yasirkula
yasirkula / ShaderStripper.cs
Last active March 4, 2024 09:40
Stripping commonly unused shader variants in Unity's built-in render pipeline
//#define SHADER_COMPILATION_LOGGING
//#define SKIP_SHADER_COMPILATION
using System.Collections.Generic;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
public class ShaderStripper : IPreprocessShaders
@ditzel
ditzel / MeshDestroy.cs
Created August 19, 2019 19:02
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;