Skip to content

Instantly share code, notes, and snippets.

@benloong
benloong / PageViewController.cs
Created January 6, 2017 07:18
Unity UI system PageViewController
using System;
using UnityEngine;
using UnityEngine.EventSystems;
public class PageViewController : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IInitializePotentialDragHandler
{
public enum Direction
{
Horizontal,
Vertical
@mickdekkers
mickdekkers / SnapshotCamera.cs
Last active December 4, 2024 13:46
Take snapshot images of Prefabs and GameObjects in Unity using Render Textures
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
// Object rendering code based on Dave Carlile's "Create a GameObject Image Using Render Textures" post
// Link: http://crappycoding.com/2014/12/create-gameobject-image-using-render-textures/
@CloudyWater
CloudyWater / DashTrailObject.cs
Created August 15, 2016 18:50
Unity 2D Sprite Trail Object
using UnityEngine;
using System.Collections;
public class DashTrailObject : MonoBehaviour
{
public SpriteRenderer mRenderer;
public Color mStartColor, mEndColor;
private float mDisplayTime;
private float mTimeDisplayed;
@bitbutter
bitbutter / TransparentBackgroundScreenshotRecorder.cs
Last active February 1, 2025 23:54
Rendering screenshots from Unity3d with transparent backgrounds
using UnityEngine;
using System.Collections;
using System.IO;
/*
Usage:
1. Attach this script to your chosen camera's game object.
2. Set that camera's Clear Flags field to Solid Color.
3. Use the inspector to set frameRate and framesToCapture
@korya
korya / Subfolder to git repo.md
Last active March 25, 2025 09:39
Convert subfolder into Git submodule