Skip to content

Instantly share code, notes, and snippets.

View Bezhok's full-sized avatar
🏠
Working from home

Bezhok Nikita Bezhok

🏠
Working from home
View GitHub Profile
@nemotoo
nemotoo / .gitattributes
Last active October 14, 2024 00:03
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@djcsdy
djcsdy / Unity with source control.md
Last active October 5, 2024 13:46
Unity with source control

In the Unity editor:

  1. Edit -> Project Settings -> Editor
  2. In the inspector panel, set:
  3. Version Control -> Mode: Visible Meta Files
  4. Asset Serialization -> Mode: Force Text

“Visible Meta Files” causes Unity to place .meta files next to each of your assets. It’s important to check these files into version control because they contain the settings associated with those assets that you set in the Unity editor.

“Asset Serialization: Force Text” causes Unity to write its .meta and other files in a more-or-less human-readable text format, which makes it a lot easier to understand what has changed when you look at version control logs. Also it’s feasible to merge these text files by hand, whereas it’s not really possible to do that with Unity’s default binary file format.

@drawcode
drawcode / .gpu-instancing.md
Last active July 29, 2024 09:27
Unity GPU Instancing

https://docs.unity3d.com/Manual/GPUInstancing.html

GPU Instancing (Unity)

Introduction

Use GPU Instancing to draw (or render) multiple copies of the same Mesh at once, using a small number of draw calls. It is useful for drawing objects such as buildings, trees and grass, or other things that appear repeatedly in a Scene .

GPU Instancing only renders identical Meshes with each draw call, but each instance can have different parameters (for example, color or scale) to add variation and reduce the appearance of repetition.

@StagPoint
StagPoint / AddAnimationClipsToControllerAsset.cs
Created December 5, 2021 18:50
Unity editor script that adds existing AnimationClip assets to the AnimationController asset that uses them, cutting down on clutter and making it easier to manage your controllers and their associated animation clips.
namespace StagPoint.EditorUtils
{
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.Animations;