IEnumerator createLightsFromMarathonMap(Weland.Level Level) { string load = loadingText; for (int i = 0; i < Level.Lights.Count; i++) { Weland.Light light = Level.Lights[i]; mapLight ml = gameObject.AddComponent <mapLight>(); ml.id = i; ml.mapTag = light.TagIndex; ml.stateless = light.Stateless; ml.initiallyActive = light.InitiallyActive; ml.phase = light.Phase; ml.becomingActive.setFromMarathonObject(light.BecomingActive); ml.primaryActive.setFromMarathonObject(light.PrimaryActive); ml.secondaryActive.setFromMarathonObject(light.SecondaryActive); ml.becomingInactive.setFromMarathonObject(light.BecomingInactive); ml.primaryInactive.setFromMarathonObject(light.PrimaryInactive); ml.secondaryInactive.setFromMarathonObject(light.SecondaryInactive); if (light.Type == Weland.LightType.Strobe) { ml.type = 1; } if (light.Type == Weland.LightType.Media) { ml.type = 2; } lights.Add(ml); } yield return(null); }
public LevelEntity_Light(short index, Weland.Light light, LevelEntity_Level level) { if (!LightTexture) { LightTexture = new Texture2D( width: 256, height: 1, textureFormat: TextureFormat.R16, mipChain: false, linear: false); LightTexture.wrapMode = TextureWrapMode.Clamp; LightTexture.filterMode = FilterMode.Point; Shader.SetGlobalTexture(lightIntensityGlobalPropertyId, LightTexture); } NativeIndex = index; NativeObject = light; ParentLevel = level; BeginRuntimeStyleBehavior(); }