Skip to content

Instantly share code, notes, and snippets.

View Thundernerd's full-sized avatar
🎉

Christiaan Bloemendaal Thundernerd

🎉
View GitHub Profile
@ZimM-LostPolygon
ZimM-LostPolygon / UnityGuidRegenerator.cs
Last active June 3, 2024 07:38
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
@nemotoo
nemotoo / .gitattributes
Last active June 20, 2024 09:44
.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
@lgorny
lgorny / NTPDate.cs
Last active November 27, 2022 13:32
Implementation of simplified NTP protocol in Unity. Based on http://ftvoid.com/blog/post/847
using UnityEngine;
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Threading;
/// <summary>
/// Class implements simplified NTP protocol. Based on RFC 5905 (https://www.ietf.org/rfc/rfc5905.txt)
/// </summary>
@yasirkula
yasirkula / SnapRectTransformAnchorsToCorners.cs
Created May 28, 2024 18:20
Snap a RectTransform's anchors to its corner points in Unity
using UnityEditor;
using UnityEngine;
public class SnapRectTransformAnchorsToCorners : MonoBehaviour
{
[MenuItem("CONTEXT/RectTransform/Snap Anchors To Corners", priority = 50)]
private static void Execute(MenuCommand command)
{
RectTransform rectTransform = command.context as RectTransform;
RectTransform parent = rectTransform.parent as RectTransform;