Brian-Jiang / PragmaTimeline

Pragma Timeline is a tool that can let you easily bind runtime objects to the timeline you created.

Home Page:https://brian-jiang.github.io/PragmaTimeline/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pragma Timeline

version 0.7.2

Summary

Pragma Timeline is a tool that can let you easily play timeline in runtime and bind to your scene objects. It supports exposed reference and generic binding, including your own track and clip.
To understand how it works, please read this article.

Quick Start

  1. Create a scene by click File -> New Scene -> PragmaTimelineEdit. This scene is only used for editing timeline.
  2. Copy paste objects that you want to use in timeline to your new scene.
  3. Create a timeline asset by right click in Assets panel and click Create -> Timeline. Then drag it to playable director of the Timeline game object in the scene.
  4. Drag Timeline game object to the Assets panel to make it a prefab.
  5. You can now start editing your timeline. See Unity Timeline for more information.
  6. When you finish, click the Update button on the inspector of the Timeline game object's TimelinePlayer component. This will create several records of objects that you need to bind in runtime. Change name of the records to something meaningful. Note that these are the names you will use in script.
  7. At runtime, play your timeline using following code:
    var instance = Instantiate(prefab);
    var player = instance.GetComponent<TimelinePlayer>();

    var map = new Dictionary<string, object> {
        {"name1", object1},
        {"name2", object2},
    };
    player.Init(map);
    
    player.Stopped += playableDirector => {
        Debug.Log("Timeline stopped");
    };
    
    player.PlayTimeline(true);

Supports

If you have any questions, please comment at Asset Store
or leave an issue at Github.
Thank you for your support!

About

Pragma Timeline is a tool that can let you easily bind runtime objects to the timeline you created.

https://brian-jiang.github.io/PragmaTimeline/


Languages

Language:C# 100.0%