zy-game / LitMotion

Lightning-fast and Zero Allocation Tween Library for Unity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LitMotion

Lightning-fast and Zero Allocation Tween Library for Unity.

license

日本語版READMEはこちら

Overview

LitMotion is a high-performance tweening library for Unity. It encompasses a rich set of features to animate components like Transform, along with custom fields and properties, allowing for easy creation of animations.

Following my creation of Magic Tween, LitMotion stands as my second tweening library. Leveraging the experience gained from implementing Magic Tween, LitMotion has been designed prioritizing essential features while ensuring it operates at the highest speed possible. It outperforms other tweening libraries by a staggering 2 to 20 times in various situations such as tween creation and execution. Naturally, there are no allocations during tween creation.

Documentation

The full version of documentation can be found here.

Features

  • Animate anything in one line of code.
  • Achieves zero allocations due to its struct-based design.
  • Highly optimized using DOTS (Data-Oriented Technology Stack).
  • Works in both runtime and editor.
  • Apply complex settings like easing and looping.
  • Wait for completion via callbacks/coroutines.
  • Zero allocation string animation with FixedString and TextMeshPro
  • Convert to Observables using UniRx.
  • Supports async/await via UniTask.
  • Extend types using IMotionOptions and IMotionAdapter.

Setup

Requirements

  • Unity 2021.3 or later
  • Burst 1.6.0 or later
  • Collection 1.5.1 or later
  • Mathematics 1.0.0 or later

Installation

  1. Open Package Manager from Window > Package Manager.
  2. Click the "+" button > Add package from git URL.
  3. Enter the following URL:
https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion

Alternatively, open Packages/manifest.json and add the following to the dependencies block:

{
    "dependencies": {
        "com.annulusgames.lit-motion": "https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion"
    }
}

Performance

Here are the benchmark results. The benchmark source code can be found in this repository.

Tween 64,000 float properties

Startup

Update

Tween 50,000 transform.position

Startup

Update

GC Allocation (per position tween creation)

Support

Untiy forum: https://forum.unity.com/threads/litmotion-lightning-fast-and-zero-allocation-tween-library.1530427/

License

MIT License

About

Lightning-fast and Zero Allocation Tween Library for Unity.

License:MIT License


Languages

Language:C# 100.0%