Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Global FeedbacksPlayers

Guillem SC edited this page Nov 20, 2020 · 7 revisions

Home >> Usage guide >> Global FeedbacksPlayers

Global FeedbacksPlayers

If you won't want to directly reference FeedbacksPlayer components through the editor, you can get them using a global reference:

Setup:

To start, you need to select the toggle named Used By Script, and then assign a unique id for your FeedbacksPlayer.

Usage:

Then, from code (with the namespace Juce.Feedbacks), you just need to use JuceFeedbacks.GetFeedbacksPlayer, with the id that you set on the editor:

You can also the safe version JuceFeedbacks.TryGetFeedbacksPlayer, that will return false if the FeedbacksPlayer is not found, and output the FeedbacksPlayer if found.

Warning:

  • If the toggle Used By Script is not selected, you won't be able to retrieve the FeedbacksPlayer.
  • The id cannot be empty.
  • The id needs to be unique for all the FeedbacksPlayers avaliable on the current loaded scenes. If there is two duplicate ids, an error will prompt on the console.

Clone this wiki locally