Giter Club home page Giter Club logo

raytween's Introduction

Special Thanks

This library is based on the following libraries created by AnnulusGames.

TweenSystem

LitMotion

Path tween

MagicTween

Performance

Comparing with LitMotion, start up performance is 1.1 times slower, and the update performance is same. Exceptionally, string tween is faster than LitMotion.

How to install

Package Manager

  1. Open the Package Manager by going to Window > Package Manager.
  2. Click on the "+" button and select "Add package from git URL".
  3. Enter the following URL:
https://github.com/Akeit0/RayTween.git?path=/RayTween/Packages/RayTween

manifest.json

Open Packages/manifest.json and add the following in the dependencies block:

"com.akeit0.com.akeit0.ray-tween": "https://github.com/Akeit0/RayTween.git?path=/RayTween/Packages/RayTween"
void TMPCharMotionExample()
{
    // Get the number of characters from TMP_Text.textInfo.characterCount
    for (int i = 0; i < text.textInfo.characterCount; i++)
    {
        RTween.Create(Color.white, Color.red, 1f).BindToTMPCharColor(text, i)
            .SetDelay(i * 0.1f)
            .SetEase(Ease.OutQuad);

        RTween.Punch.Create(Vector3.zero, Vector3.up * 15f, 1f).BindToTMPCharPosition(text, i)
            .SetDelay(i * 0.1f)
            .SetEase(Ease.OutQuad);
    }
}
async UniTaskVoid Circle(int count)
{
   using PreservedTween<Vector3,Path3DTweenPlugin> p = RTween.CreatePath3D(3f).BindToPosition(transform).WithPath(
            Path.AsSpan()).SetOptions(new PathTweenOptions(PathType.CatmullRom, true)).SetEase(Ease.OutSine)
        .SetLoops(3, LoopType.Flip).Preserve();

    for (int i = 0; i < count; i++)
    {
        RTween.Create(4f, 0.3f).BindToPositionY(transform).SetEase(Ease.OutSine).SetLoops(2, LoopType.Yoyo)
            .Forget();

        await RTween.Create(4f, 0.3f).BindToPositionX(transform).SetEase(Ease.InSine);

        await RTween.Create(8f, 0.3f).BindToPositionX(transform).SetEase(Ease.OutSine);

        RTween.Create(-4f, 0.3f).BindToPositionY(transform).SetEase(Ease.OutSine).SetLoops(2, LoopType.Yoyo)
            .Forget();

        await RTween.Create(4f, 0.3f).BindToPositionX(transform).SetEase(Ease.InSine);

        await RTween.Create(0f, 0.3f).BindToPositionX(transform).SetEase(Ease.OutSine);
    }
}

License

MIT License

https://github.com/AnnulusGames/LitMotion/blob/main/LICENSE

https://github.com/AnnulusGames/MagicTween/blob/main/LICENSE

raytween's People

Contributors

akeit0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.