public void CreateTubeLights(GameObject go) { if (tbppLights == null) { tbppLights = new List <BloomPrePassLight>(); } if (tubeLightDescriptors == null) { tubeLightDescriptors = new List <TubeLight>(); } TubeLight[] localDescriptors = go.GetComponentsInChildren <TubeLight>(true); if (localDescriptors == null) { return; } foreach (TubeLight tl in localDescriptors) { BloomPrePassLight tubeBloomLight; if (tl.GetComponent <MeshFilter>().mesh.vertexCount == 0) { tubeBloomLight = tl.gameObject.AddComponent <TubeBloomPrePassLight>(); (tubeBloomLight as TubeBloomPrePassLight).Init(); } else { tubeBloomLight = tl.gameObject.AddComponent <MeshBloomPrePassLight>(); (tubeBloomLight as MeshBloomPrePassLight).Init(); } ReflectionUtil.SetPrivateField(tubeBloomLight, "_width", tl.width); ReflectionUtil.SetPrivateField(tubeBloomLight, "_length", tl.length); ReflectionUtil.SetPrivateField(tubeBloomLight, "_center", tl.center); tubeBloomLight.color = tl.color; ReflectionUtil.SetPrivateFieldBase(tubeBloomLight, "_ID", (int)tl.lightsID); tbppLights.Add(tubeBloomLight); tubeLightDescriptors.Add(tl); } }