internal void AddToBaseManager(BaseManager managers = null) { SubRoot = GetComponentInParent <SubRoot>() ?? GetComponent <SubRoot>(); if (SubRoot == null) { return; } Manager = managers ?? BaseManager.FindManager(SubRoot); Manager.AddBaseUnit(this); }
public void AddToManager(BaseManager managers = null) { if (SubRoot == null) { SubRoot = GetComponentInParent <SubRoot>() ?? GetComponent <SubRoot>() ?? GetComponentInChildren <SubRoot>(); } if (SubRoot == null) { QuickLogger.Error <QuantumTeleporterController>("SubRoot returned null"); return; } Manager = managers ?? BaseManager.FindManager(SubRoot); Manager.AddBaseUnit(this); QuickLogger.Debug($"{Mod.FriendlyName} has been connected", true); }