public LightLayer(IConverter <Vector2Int, Vector3> coordinateConverter, LightConfiguration configuration, IEnumerable <string> raycastLayers) { _coordinateConverter = coordinateConverter; _configuration = configuration; _raycastMask = LayerMask.GetMask(raycastLayers.ToArray()); }
public LightPresets(LightConfiguration l) { lc = l; /*Preset p1 = new Preset(); p1.p_name = "LightPresets.Inside"; p1.l_intensity = 0.2f; p1.s_blur = 3f; p1.s_power = 0.9f; p1.r_id = 1; p1.r_rate = 0; p1.imgBackground_r = 128; p1.imgBackground_g = 128; p1.imgBackground_b = 128; p1.id = 0;*/ Preset p2 = new Preset(); p2.p_name = "LightPresets.LightingOutdoor"; p2.l_intensity = 0.3f; p2.s_blur = 2.8f; p2.s_power = 0.4f; p2.r_id = 6; p2.r_rate = 0; p2.imgBackground_r = 128; p2.imgBackground_g = 128; p2.imgBackground_b = 128; p2.id = 1; Preset p3 = new Preset(); p3.p_name = "LightPresets.CloudyOutdoor"; p3.l_intensity = 0.2f; p3.s_blur = 6f; p3.s_power = 0.8f; p3.r_id = 6; p3.r_rate = 0; p3.imgBackground_r = 128; p3.imgBackground_g = 128; p3.imgBackground_b = 128; p3.id = 2; Preset p4 = new Preset(); p4.p_name = "LightPresets.Night"; p4.l_intensity = 0.05f; p4.s_blur = 6f; p4.s_power = 1.0f; p4.r_id = 6; p4.r_rate = 0; p4.imgBackground_r = 33; p4.imgBackground_g = 44; p4.imgBackground_b = 80; p4.id = 3; //presetsList.Add(p1); presetsList.Add(p2); presetsList.Add(p3); presetsList.Add(p4); }
public void SetChannelValue(Control ctrl, //ref byte val, Headbanger light, HeadBangerCommandSet command, Func <byte, byte> incDecCallback) { byte _channel = LightConfiguration.getChannel(light, command); var val = light.getValuefromCommand(command); val = incDecCallback(val); OpenDMX.setDmxValue(_channel, val); light.setValuefromCommand(command, val); ctrl.Text = val.ToString(); }
void SetupLights(LightConfiguration lightconfig) { int offset = 3; if (lightconfig == LightConfiguration.ONE) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i]; } } else if (lightconfig == LightConfiguration.TWO) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + offset]; } } else if (lightconfig == LightConfiguration.THREE) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 2)]; } } else if (lightconfig == LightConfiguration.FOUR) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 3)]; } } else if (lightconfig == LightConfiguration.FIVE) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 4)]; } } else if (lightconfig == LightConfiguration.SIX) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 5)]; } } else if (lightconfig == LightConfiguration.SEVEN) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 6)]; } } else if (lightconfig == LightConfiguration.EIGHT) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 7)]; } } else if (lightconfig == LightConfiguration.NINE) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 8)]; } } else if (lightconfig == LightConfiguration.TEN) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 9)]; } } else if (lightconfig == LightConfiguration.ELEVEN) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 10)]; } } else if (lightconfig == LightConfiguration.TWELVE) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 11)]; } } else if (lightconfig == LightConfiguration.CONTROL) { for (int i = 0; i < 3; i++) { roomCombination[i] = chainValues[i + (offset * 12)]; } } }
//----------------------------------------------------- void Start() { //if((PC.DEBUG && DEBUG) || PC.DEBUGALL) Debug.Log(DEBUGTAG+"Start"); if(m_mainScene == null) Debug.LogError(DEBUGTAG+"Main Scene" +PC.MISSING_REF); if(m_backgroundImg == null) Debug.LogError(DEBUGTAG+"Background Img" +PC.MISSING_REF); if(m_grassSkybox == null) Debug.LogError(DEBUGTAG+"Grass skybox" +PC.MISSING_REF); m_zones = new LinkedList<GrassV2zone>(); m_undoedZones = new Stack<GrassV2zone>(); m_backupZones = new List<GrassV2zone>(); m_zonesVec = new LinkedList<IEv2_Zone>(); m_undoedZoneVec = new Stack<IEv2_Zone>(); m_mask = null; // Mask initialisé dans Reset (appelé par d'autres modules OS3D) m_zoneAdded = false; m_needMaskUpdate = false; // m_newZone = null; m_updatingCount = 0; m_needMaskApply = false; m_pixIn = new Rect(); m_mustAddZones = false; m_zonesToAdd = null; m_zonesTexIDtoAdd = null; m_zonesTexGenToAdd = null; lightconfig = GameObject.Find ("LightPivot").GetComponent<LightConfiguration>(); }
void Start() { if(Mathf.Abs(transform.localPosition.y)<0.15f) { liner = transform.parent.FindChild("liner"); if(liner==null) liner = transform.parent.FindChild("coque"); liner.transform.localScale = new Vector3(1.0f,0.5f,1.0f); } if(usefullData.lowTechnologie) { /*gameObject.AddComponent<AnimatedTexture_decal>(); AnimatedTexture_decal anim = gameObject.GetComponent<AnimatedTexture_decal>(); anim.nameImgList = "caustics"; anim.nameShader = "Custom/FX/Water p"; anim.nameTexture = "_HorizonColor"; anim.LoadData();*/ Texture2D fallBacktexture = (Texture2D) Resources.Load("water/water", typeof(Texture2D)); gameObject.GetComponent<Renderer>().material.SetTexture("_MainTex",fallBacktexture); /*liner = transform.parent.FindChild("liner"); if(liner==null) liner = transform.parent.FindChild("coque");*/ // liner.transform.localPosition = new Vector3(0.0f,0.5f,0.0f); } if( gameObject.GetComponent<Renderer>().material.HasProperty("_WaveScale")) initWave = gameObject.GetComponent<Renderer>().material.GetFloat ("_WaveScale"); if( gameObject.GetComponent<Renderer>().material.HasProperty("_LightPos")) gameObject.GetComponent<Renderer>().material.SetVector("_LightPos", new Vector4(0.0f,0.463f,0.882f,0.0f)); /*if( gameObject.renderer.material.HasProperty("_ReflDistort")) initRefrac = gameObject.renderer.material.GetFloat ("_ReflDistort"); if( gameObject.renderer.material.HasProperty("_RefrDistort")) initReflect = gameObject.renderer.material.GetFloat ("_RefrDistort");*/ Material mat = GetComponent<Renderer>().sharedMaterial; if( !mat ) return; Vector4 waveSpeed = mat.GetVector( "WaveSpeed" )/5.0f; mat.SetVector( "WaveSpeed",waveSpeed ); mat.SetFloat( "_WaveScale",-0.1f ); mat.SetFloat("_ReflDistort",0.5f ); mat.SetFloat("_RefrDistort",0.5f ); mainLight = GameObject.Find ("sunLight"); mainLightConfiguration = GameObject.Find ("LightPivot").GetComponent<LightConfiguration> (); }
//----------------------------------------------------- void Start() { m_objInter=GameObject.Find("mainCam").GetComponent<ObjInteraction>(); if (grassNode==null) Debug.LogError(DEBUGTAG+"grassNode"+PC.MISSING_REF); if (gommeNode==null) Debug.LogError(DEBUGTAG+"gommeNode"+PC.MISSING_REF); if (m_mode2D == null) Debug.LogError(DEBUGTAG+"Mode2D"+PC.MISSING_REF); m_off7 = Screen.width; m_slideTouchEnded = false; // touchOldPos = new Queue<Vector2>(); // touchCount = 0; othersMenu = new ArrayList(); foreach(Component cp in this.GetComponents<MonoBehaviour>()) { if(cp.GetType() != this.GetType() && cp.GetType().GetInterface("GUIInterface")!= null) { othersMenu.Add(cp); } } //shortcuts _camPivot = GameObject.Find("camPivot"); if(_camPivot!=null) sc = _camPivot.GetComponent<SceneControl>(); GameObject lightPivot = GameObject.Find("LightPivot"); if(lightPivot!=null) { lc = lightPivot.GetComponent<LightConfiguration>(); } _lightEffects = GameObject.Find("lightEffects"); if(_lightEffects!=null) { _lightEffectsParentNode = _lightEffects.transform.parent; } interacteur = Camera.main.GetComponent<ObjInteraction>(); _grid = GameObject.Find("grid"); _mainNode = GameObject.Find("MainNode"); _childrenNodes = new ArrayList(); // //CREATION DE LA GUI // CreateGui(); //Before/After c_camCull = Camera.main.cullingMask; // s2hRect = new Rect(Screen.width/2-256,-200,512,200); //ConfirmationBox _cb = GetComponent<GUIDialogBox>(); initLanguages(); if(GameObject.Find("_avatar")) { _avatarControl = GameObject.Find("_avatar").GetComponent<Avatar>(); avatarTransform = GameObject.Find("_avatar").transform; } _pluginPhotoRef = GetComponent<PluginPhotoManagerGUI>(); }