static internal void _UnregisterType(RegisteredComponent component, Type type) { InstanceContainer container = _GetInstanceContainer(type); if (!container.Remove(component)) { Debug.LogError("RegisteredComponentController error: Tried to unregister unknown instance"); } //Debug.Log( "Unregistered " + type.Name + ": " + component.gameObject.name ); }
static private void _RegisterType(RegisteredComponent component, Type type) { InstanceContainer container = _GetInstanceContainer(type); if (!container.Add(component)) { Debug.LogError("RegisteredComponentController error: Tried to register same instance twice"); } //Debug.Log( "Registered " + type.Name + ": " + component.gameObject.name ); }
static internal void _Unregister(RegisteredComponent component) { Type type = component.GetType(); do { _UnregisterType(component, type); type = type.BaseType; } while (type != typeof(RegisteredComponent)); //Debug.Log( "Unregistered " + component.GetType().Name + ": " + component.gameObject.name ); }