Comment on page
Add the "Blackboard" prefab from the Repositories folder to your project. The
Blackboard.cscomponent is already attached here.
The Blackboard component is the central hub for all of the Blackboard actions. Add this to the top of any script which utilizes it:
using static InfinityPBR.Modules.MainBlackboard;
// Refer to Blackboard Note, Blackboard Event, and Blackboard Values for additional code references.
// Obtaining a specific value from a Blackboard Note
GameStat gameStat = Blackboard.ValueGameStat(topic, subject);
// Doing something with a specific value from a Blackboard Note
public float FloatValue => Blackboard.ValueFloat(topic, subject);
The best way to interact with the Blackboard is to have your class inherit from
BlackboardFollower, which will automatically subscribe and unsubscribe it to event and note notifications. All you have to do is override the methods so you can choose how to handle the notifications as they come in.
The Gametime module has a
Timeboardobject which has it's own Blackboard. It is used to send information out, and also keep track of time without requiring objects to access the
Gametimedata directly. Check it out to see how it talks with its blackboard object.