UnityTechnologies / open-project-1

Unity Open Project #1: Chop Chop
http://unity.com/open-projects
Apache License 2.0
5.75k stars 2.03k forks source link

Closed Captioning system for SFX #498

Open codeedward opened 3 years ago

codeedward commented 3 years ago

I added Closed Captioning system for SFX. All my journey, considerations, screenshots and final video which presents the functionality in the game is available in the forum thread (link below): https://forum.unity.com/threads/subtitle-system-for-sfx.1038562/

What is added:

Quick description:

  1. Main class responsible for this functionality is ClosedCaptioningManger. It sits in the Gameplay scene. It listens to the AudioCueEventChannelSO (same event which AudioManager listens to). Previously I was using PersistenManagers but realised it wasn't the best place for it.
  2. DisplayCaption method displays the caption for 'Duration' number of seconds (set in the AudioClipsGroup).
  3. If AudioCueSO has more than one AudioClipGroup then it will be displayed with the offset.
  4. Update method of the ClosedCaptioningManger takes care of the off-screen functionality.
  5. Separate prefab is created for the Caption so if someone with graphic skills would like to can make the caption to look awesome :)

I had a great fun creating this. Not mentioning I've learned a lot! Hope this will be useful.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.