-
Notifications
You must be signed in to change notification settings - Fork 79
Cyclops Manager Origin Story
The CyclopsManager was a design pattern born out of necessity.
When modded Buildables were newly constructed inside the Cyclops or were being loaded from save data,
it was often the issue that the Buildable's main Monobehavior
wasn't able to find the Cyclops SubRoot
by looking through its own parent components.
// From the buildable's main MonoBehavior
private void Start()
{
SubRoot cyclops = this.gameObject.GetComponentInParent<SubRoot>();
// Searching from child to parent would actually return null even though the monobehavior is in a Cyclops
However, it was possible to find the Buildable's component by starting at the Cyclops SubRoot
and looking through its child components.
// From the Aux Cyclops Manager
internal void Find()
{
SubRoot cyclops = Cyclops;
MyCyclopsBuildable[] buildables = cyclops.GetAllComponentsInChildren<MyCyclopsBuildable>();
// Searching from parent to child would return the monobehaviors in the Cyclops they couldn't find themselves
Because of these complications, a new design pattern was made to help link Buildables with their parent Cyclops.
You will see this pattern used in the CyclopsNuclearReactor and CyclopsBioReactor.
The pattern would go on to have a few more uses, but this is where it started.
CbItem Patching.dll
Text Pack Patching.txt
The Cyclops Upgrade Cycle
Single UpgradeHandlers
Grouped UpgradeHandlers
Registering UpgradeHandlers
Finding UpgradeHandlers
Creating Icon Overlays
Registering Icon Overlays
The Cyclops Charge Cycle
Creating Cyclops Chargers
Registering Cyclops Chargers
Finding Cyclops Chargers
Origin Story
Cyclops Manager Promises
Creating Your Manager
Registering Your Managers
Finding Auxiliary Managers