private void OnEntityKill(ContainerIOEntity entity) { BuildingPrivlidge priv = entity.GetBuildingPrivilege(); if (priv == null) { return; } _ioEntity[priv.buildingID]?.Remove(entity); }
private void OnEntitySpawned(ContainerIOEntity entity) { BuildingPrivlidge priv = entity.GetBuildingPrivilege(); if (priv == null) { return; } if (!_ioEntity.ContainsKey(priv.buildingID)) { _ioEntity[priv.buildingID] = new List <IOEntity> { entity }; } else { _ioEntity[priv.buildingID].Add(entity); } }