Skip to content

Unity tool used to create visualizations for youtube

License

Notifications You must be signed in to change notification settings

JohnSongNow/Piro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Piro

Introduction

I created this tool called Piro to help me display and visualize concepts better for my YouTube videos. Originally I wrote a similar code back there in Godot used an earlier pathfinding and parallel programming videos. I've since then ported the tool into Unity as a modernization process.

Examples of videos

This tool is used to visualize new concepts, and is made available to anyone that wishes to tinker and run the visualizations themselves. My Video Repository can be found with a list of the scenes used for each video. Although the tool is new, there is no guarantee that each will is backwards compatible! To ensure that the cinematic can be run please use the version that matches the videos release date.

Setup

To use this tool first download Unity, this project current uses 2020.3.24f1.

This tool uses C#, you can look at the C# Docs for more in depth documentation. It also makes extensive use of the Coroutines to control the flow of Cutscene and Cinematic nodes.

Usage

Each video is broken up in terms of Cinematic and Cutscene classes.

Cinematic is the root node of each scene and contains Cutscene nodes as their children. A Cinematic allow us to contain and cycle through each cutscene. By default, all Cutscene nodes of a cinematic are set to non visible except the active cutscene.

Cutscene nodes are direct children of the Cinematic nodes and contain child nodes used to render and display. They have a function called Play which allows them to change and manipulate the scene.

The main signal of StepBegan allows us to control the flow of the cutscene by waiting for input until the user presses the next key Q. How you rig the scene is completely up your preference however. I recommend the scene with the following node structure.

SceneRoot
 - Camera
 - EventSystem
 - Canvas
 - Cinematic
 - Cutscene1
 - Cutscene2
 ...
    - CinematicControls

Please follow the Bubble Sort Scene as an example!

Lastly you'll need to hook up your cutscenes to the cinematic by dragging them into the slots on the cinematic node. image

Below is an example of a standard Play method.

public override async void Play()
{ 
 yield return base.Play();

 ListVisualSorts.waitTime = 0.1f;
 List numbers = Enumerable.Range(1, 20).ToList();
 ListVisualSorts.ShuffleNumbers(numbers);
 bubbleListVisual.SetNumbers(numbers);
 mergeListVisual.SetNumbers(new List(numbers));
 quickListVisual.SetNumbers(new List(numbers));
 OnStepEnded();

 yield return new WaitForNextStep(this);
 Coroutine bubble = StartCoroutine(ListVisualSorts.BubbleSort(bubbleListVisual));
 Coroutine merge = StartCoroutine(ListVisualSorts.MergeSort(mergeListVisual, mergeHelperListVisual));
 Coroutine quick = StartCoroutine(ListVisualSorts.QuickSort(quickListVisual));
 yield return bubble;
 yield return merge;
 yield return quick;
 OnStepEnded();
}

Cutscene Control

image_001_0000 The cutscene controls offers a way of manging which scene is currently active as well as provides a legend for the controls. It's visibility can be toggled on/off by pressing T.

Recording

I use the plugin Unity Recorder to record the cutscenes generated from Piro.

Contributing/Error Correction

If you see any error or would like to contribute to this repository feel free to send me a message and/or submit a pull request.

As of right now there are no plans to convert the PathFinding video to use this newer library, please use Godot Video Tools to view older videos.

License

This uses the MIT license.

About

Unity tool used to create visualizations for youtube

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages