Skip to content

Instantly share code, notes, and snippets.

View RimuruDev's full-sized avatar
🌅
Meow :3

Rimuru RimuruDev

🌅
Meow :3
View GitHub Profile
@RimuruDev
RimuruDev / .gitattributes
Created August 11, 2025 12:43 — forked from inikitin/.gitattributes
.gitattributes for Unity with case-insensitive Git LFS extension filters
# Unity specific .gitattributes
* text=auto
*.cs diff=csharp text
*.cginc text
*.shader text
# Unity YAML
*.anim -text merge=unityyamlmerge diff
@RimuruDev
RimuruDev / Either.cs
Created December 11, 2024 09:37 — forked from adammyhre/Either.cs
Monads, Nullables, and the Power of Optionals in Unity
using System;
using System.Collections.Generic;
public struct Either<TLeft, TRight> {
readonly TLeft left;
readonly TRight right;
readonly bool isRight;
Either(TLeft left, TRight right, bool isRight) {
this.left = left;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using System.Linq;
public class InputFieldFormatter : MonoBehaviour
{
[SerializeField] private string startValue = "10.02.2024";
[SerializeField] private string pattern = "&&.&&.&&&&";
[SerializeField] private char splitChar = '.';
@RimuruDev
RimuruDev / IAPManager.cs
Created September 18, 2024 11:56 — forked from yasirkula/IAPManager.cs
A wrapper script for Unity IAP (In-App Purchases) that can be used for common IAP tasks
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
using UnityEngine.Purchasing.Security;
public class IAPManager : IStoreListener
{
public enum State { PendingInitialize, Initializing, SuccessfullyInitialized, FailedToInitialize };
@RimuruDev
RimuruDev / EmojiHelper.cs
Created August 2, 2024 20:53 — forked from mopsicus/EmojiHelper.cs
Helper for TextMeshPro to find and parse emoji
// ----------------------------------------------------------------------------
// The MIT License
// EmojiHelper https://gist.github.com/mopsicus/3903a1f111a738375a363b9e3f058385
// Copyright (c) 2022 Mopsicus <[email protected]>
// ----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Collections;
using UnityEngine;
using UnityEngine.EventSystems;
public class SwipeDetector : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
private Vector2 lastPosition;
public Vector2 swipeDelta;
private Coroutine coroutine;
@RimuruDev
RimuruDev / PlayerLoopCleaner.cs
Created May 20, 2024 08:59 — forked from olegmrzv/PlayerLoopCleaner.cs
PlayerLoop Disable Unity Modules
using System;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class PlayerLoopCleaner
{
private static readonly Type[] typesToRemove = new Type[] {
typeof(EarlyUpdate.Physics2DEarlyUpdate),
// Physics 2D
@RimuruDev
RimuruDev / psd2png.sh
Created May 19, 2024 07:28 — forked from rawaludin/psd2png.sh
Batch Convert PSD to PNG in Mac OS X
#!/bin/bash
for i in *psd
do
name=${i%.psd}
convert "$name.psd[0]" -resize 100% "$name.png"
done
@RimuruDev
RimuruDev / EditPrefab.cs
Created May 14, 2024 09:51 — forked from ulrikdamm/EditPrefab.cs
Unity editor script for better editing of prefabs. Put in Assets/Editor.
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
// Adds a "Edit Prefab" option in the Assets menu (or right clicking an asset in the project browser).
// This opens an empty scene with your prefab where you can edit it.
// Put this script in your project as Assets/Editor/EditPrefab.cs
public class EditPrefab {
static Object getPrefab(Object selection) {
@RimuruDev
RimuruDev / CustomInspectorCreator.cs
Created May 8, 2024 08:13 — forked from LotteMakesStuff/CustomInspectorCreator.cs
Editor extension that adds a tool to automagically generate boilerplate custom inspector code~ YES! Just drop it into a folder called 'Editor' and it adds a 'custom inspector' option into the Project window!
using UnityEngine;
using UnityEditor;
using System.IO;
public static class CustomInspectorCreator
{
[MenuItem("Assets/Create/Custom Inspector", priority = 81)]
static void CreateInsptorEditorClass()
{
foreach (var script in Selection.objects)