void OnDisable() { allPortals.Remove(this); if (frontSector) { frontSector.Deregister(this); } if (backSector) { backSector.Deregister(this); } }
protected virtual void OnDisable() { if (Changed != null && sectors.Count > 0) { Changed(sectors, null); } if (!isSector && !neverJoin) { int numSectors = sectors.Count; for (int sectorIndex = 0; sectorIndex < numSectors; ++sectorIndex) { SECTR_Sector sector = sectors[sectorIndex]; if (sector) { sector.Deregister(this); } } sectors.Clear(); } int numChildren = children.Count; for (int childIndex = 0; childIndex < numChildren; ++childIndex) { Child child = children[childIndex]; child.processed = false; childPool.Push(child); } children.Clear(); childTable.Clear(); renderers.Clear(); lights.Clear(); terrains.Clear(); if (SECTR_Modules.VIS) { shadowLights.Clear(); shadowCasters.Clear(); } bakedOnlyTable = null; allMembers.Remove(this); allMemberTable.Remove(transform); }