All Projects → DaVikingCode → Unityruntimespritesheetsgenerator

DaVikingCode / Unityruntimespritesheetsgenerator

Licence: mit
Unity – generate SpriteSheets at runtime!

Projects that are alternatives of or similar to Unityruntimespritesheetsgenerator

Harmony
A library for patching, replacing and decorating .NET and Mono methods during runtime
Stars: ✭ 2,885 (+908.74%)
Mutual labels:  unity, runtime
Rapidgui
Unity OnGUI(IMGUI) extensions for Rapid prototyping/development
Stars: ✭ 144 (-49.65%)
Mutual labels:  unity, runtime
Parse Sdk Dotnet
Parse SDK for .NET, Xamarin, Unity.
Stars: ✭ 272 (-4.9%)
Mutual labels:  unity
Discord Rpc Csharp
C# custom implementation for Discord Rich Presence. Not deprecated and still available!
Stars: ✭ 282 (-1.4%)
Mutual labels:  unity
Unity Vertex Effects
Beautiful text outline for Unity UI.
Stars: ✭ 277 (-3.15%)
Mutual labels:  unity
Rdsystem
Reaction-diffusion system with CustomRenderTexture.
Stars: ✭ 271 (-5.24%)
Mutual labels:  unity
Framework
deprecated, use : https://github.com/CatLib/CatLib
Stars: ✭ 279 (-2.45%)
Mutual labels:  unity
Valvesockets Csharp
Managed C# abstraction of GameNetworkingSockets library by Valve Software
Stars: ✭ 273 (-4.55%)
Mutual labels:  unity
Flutterunit
【Flutter 集录指南 App】The unity of flutter, The unity of coder.
Stars: ✭ 4,462 (+1460.14%)
Mutual labels:  unity
Hisocket
It is a lightweight client socket solution, you can used it in C# project or Unity3d
Stars: ✭ 275 (-3.85%)
Mutual labels:  unity
Savegamefree
Save Game Free is a free and simple but powerful solution for saving and loading game data in unity.
Stars: ✭ 279 (-2.45%)
Mutual labels:  unity
Ngx
Ngx - Neural network based visual generator and mixer
Stars: ✭ 277 (-3.15%)
Mutual labels:  unity
Merino
Merino is a narrative design tool that lets you write Yarn scripts inside the Unity Editor
Stars: ✭ 275 (-3.85%)
Mutual labels:  unity
Realtime Csg For Unity
Realtime-CSG, CSG level editor for Unity
Stars: ✭ 281 (-1.75%)
Mutual labels:  unity
Unity Editor Toolbox
Tools, custom attributes, drawers, hierarchy overlay, and other extensions for the Unity Editor.
Stars: ✭ 273 (-4.55%)
Mutual labels:  unity
Unity Weld
MVVM-style data-binding system for Unity.
Stars: ✭ 285 (-0.35%)
Mutual labels:  unity
Noahgameframe
A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
Stars: ✭ 3,258 (+1039.16%)
Mutual labels:  unity
Oscjack
Lightweight implementation of OSC server/client in C# (Unity)
Stars: ✭ 276 (-3.5%)
Mutual labels:  unity
Deep reinforcement learning course
Implementations from the free course Deep Reinforcement Learning with Tensorflow and PyTorch
Stars: ✭ 3,232 (+1030.07%)
Mutual labels:  unity
Cortex M Rt
Minimal startup / runtime for Cortex-M microcontrollers
Stars: ✭ 286 (+0%)
Mutual labels:  runtime

Unity Runtime SpriteSheets Generator

Unity and plugins provide many great ways to build Sprite Sheets. However they're used directly into Unity Editor or with an external software which is perfect in many case, but none provide the ability to generate SpriteSheets at runtime.

The RectanglePacking algorithm is a port of the AS3 version made by Ville Koskela. Assets used in the demo come from Kenney.

You could combine the generated Sprite Sheets.png with a pngquant compression via this script PngQuantNativeProcess.

Please note that Unity provides a Texture2D.PackTextures method, I didn't test it nor made benchmark performances.

Example:

Add the AssetPacker component to your GameObject:
AssetPacker

using DaVikingCode.AssetPacker;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;

public class AssetPackerExample : MonoBehaviour {
	
	public Image anim;

	AssetPacker assetPacker;
	
	void Start () {

		string[] files = Directory.GetFiles(Application.persistentDataPath + "/Textures", "*.png");

		assetPacker = GetComponent<AssetPacker>();

		assetPacker.OnProcessCompleted.AddListener(LaunchAnimations);

		assetPacker.AddTexturesToPack(files);
		assetPacker.Process();
	}

	void LaunchAnimations() {

		StartCoroutine(LoadAnimation());
	}

	IEnumerator LoadAnimation() {

		Sprite[] sprites = assetPacker.GetSprites("walking");

		int i = 0;
		while (i < sprites.Length) {

			anim.sprite = sprites[i++];

			yield return new WaitForSeconds(0.1f);

			// loop
			if (i == sprites.Length)
				i = 0;
		}
	}
}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].