internal bool HasValidLightProbeProxyVolumeOverride(Renderer renderer, int selectionCount) { LightProbeProxyVolume proxyVolumeOverride = (renderer.lightProbeProxyVolumeOverride != null) ? renderer.lightProbeProxyVolumeOverride.GetComponent <LightProbeProxyVolume>() : null; return(IsUsingLightProbeProxyVolume(selectionCount) && ((proxyVolumeOverride == null) || (proxyVolumeOverride.boundingBoxMode != LightProbeProxyVolume.BoundingBoxMode.AutomaticLocal))); }
public static void FollowConfigQuality(LightProbeProxyVolume volume) { if (ReferenceEquals(null, volume)) { return; } volume.qualityMode = HighQualityVolume.Value ? LightProbeProxyVolume.QualityMode.Normal : LightProbeProxyVolume.QualityMode.Low; }
private Bounds GetGlobalBounds() { if (base.target is LightProbeProxyVolume) { LightProbeProxyVolume target = (LightProbeProxyVolume)base.target; return(target.boundsGlobal); } return(new Bounds()); }
private Bounds GetGlobalBounds() { if (this.target is LightProbeProxyVolume) { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)this.target; return(lightProbeProxyVolume.boundsGlobal); } return(default(Bounds)); }
public static void FollowConfigEnable(LightProbeProxyVolume volume) { if (ReferenceEquals(null, volume) || volume == null) { return; } volume.enabled = EnableProbeVolume.Value; UpdateRenderers(volume); }
private static void RenderBoxGizmo(LightProbeProxyVolume probeProxyVolume, GizmoType gizmoType) { if ((s_LastInteractedEditor != null) && (s_LastInteractedEditor.sceneViewEditing && (UnityEditorInternal.EditMode.editMode == UnityEditorInternal.EditMode.SceneViewEditMode.LightProbeProxyVolumeBox))) { Color color = Gizmos.color; Gizmos.color = kGizmoLightProbeProxyVolumeColor; Vector3 originCustom = probeProxyVolume.originCustom; Matrix4x4 matrix = Gizmos.matrix; Gizmos.matrix = probeProxyVolume.transform.localToWorldMatrix; Gizmos.DrawCube(originCustom, (Vector3)(-1f * probeProxyVolume.sizeCustom)); Gizmos.matrix = matrix; Gizmos.color = color; } }
private void DoBoxEditing() { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)this.target; Vector3 sizeCustom = lightProbeProxyVolume.sizeCustom; Vector3 originCustom = lightProbeProxyVolume.originCustom; if (this.m_BoxEditor.OnSceneGUI(lightProbeProxyVolume.transform.localToWorldMatrix, LightProbeProxyVolumeEditor.kGizmoLightProbeProxyVolumeColor, LightProbeProxyVolumeEditor.kGizmoLightProbeProxyVolumeHandleColor, true, ref originCustom, ref sizeCustom)) { Undo.RecordObject(lightProbeProxyVolume, "Modified Light Probe Proxy Volume AABB"); Vector3 originCustom2 = originCustom; lightProbeProxyVolume.sizeCustom = sizeCustom; lightProbeProxyVolume.originCustom = originCustom2; EditorUtility.SetDirty(this.target); } }
private void DoBoxEditing() { LightProbeProxyVolume target = (LightProbeProxyVolume)base.target; Vector3 sizeCustom = target.sizeCustom; Vector3 originCustom = target.originCustom; if (this.m_BoxEditor.OnSceneGUI(target.transform.localToWorldMatrix, kGizmoLightProbeProxyVolumeColor, kGizmoLightProbeProxyVolumeHandleColor, true, ref originCustom, ref sizeCustom)) { Undo.RecordObject(target, "Modified Light Probe Proxy Volume AABB"); Vector3 vector3 = originCustom; target.sizeCustom = sizeCustom; target.originCustom = vector3; EditorUtility.SetDirty(base.target); } }
private Bounds GetGlobalBounds() { Bounds result; if (base.target is LightProbeProxyVolume) { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)base.target; result = lightProbeProxyVolume.boundsGlobal; } else { result = default(Bounds); } return(result); }
private void DoOriginEditing() { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)base.target; Vector3 position = lightProbeProxyVolume.transform.TransformPoint(lightProbeProxyVolume.originCustom); EditorGUI.BeginChangeCheck(); Vector3 position2 = Handles.PositionHandle(position, lightProbeProxyVolume.transform.rotation); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(lightProbeProxyVolume, "Modified Light Probe Proxy Volume Box Origin"); lightProbeProxyVolume.originCustom = lightProbeProxyVolume.transform.InverseTransformPoint(position2); EditorUtility.SetDirty(base.target); } }
public static void UpdateRenderers(LightProbeProxyVolume volume) { foreach (var renderer in volume.transform.GetComponentsInChildren <Renderer>()) { if (EnableProbeVolume.Value) { renderer.lightProbeProxyVolumeOverride = volume.gameObject; renderer.lightProbeUsage = LightProbeUsage.UseProxyVolume; } else { renderer.lightProbeProxyVolumeOverride = null; renderer.lightProbeUsage = LightProbeUsage.BlendProbes; } } }
public static int get_originCustom(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); LuaObject.pushValue(l, true); LuaObject.pushValue(l, lightProbeProxyVolume.originCustom); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
void DoOriginEditing() { LightProbeProxyVolume proxyVolume = (LightProbeProxyVolume)target; Vector3 handlePosition = proxyVolume.transform.TransformPoint(proxyVolume.originCustom); EditorGUI.BeginChangeCheck(); Vector3 newPostion = Handles.PositionHandle(handlePosition, proxyVolume.transform.rotation); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(proxyVolume, "Modified Light Probe Proxy Volume Box Origin"); proxyVolume.originCustom = proxyVolume.transform.InverseTransformPoint(newPostion); EditorUtility.SetDirty(target); } }
public static int Update(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); lightProbeProxyVolume.Update(); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
private static void RenderBoxGizmo(LightProbeProxyVolume probeProxyVolume, GizmoType gizmoType) { if (!(LightProbeProxyVolumeEditor.s_LastInteractedEditor == null)) { if (LightProbeProxyVolumeEditor.s_LastInteractedEditor.sceneViewEditing && EditMode.editMode == EditMode.SceneViewEditMode.LightProbeProxyVolumeBox) { Color color = Gizmos.color; Gizmos.color = LightProbeProxyVolumeEditor.kGizmoLightProbeProxyVolumeColor; Vector3 originCustom = probeProxyVolume.originCustom; Matrix4x4 matrix = Gizmos.matrix; Gizmos.matrix = probeProxyVolume.transform.localToWorldMatrix; Gizmos.DrawCube(originCustom, -1f * probeProxyVolume.sizeCustom); Gizmos.matrix = matrix; Gizmos.color = color; } } }
public static int get_refreshMode(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); LuaObject.pushValue(l, true); LuaObject.pushEnum(l, (int)lightProbeProxyVolume.refreshMode); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static void FollowConfigDensity(LightProbeProxyVolume volume) { if (ReferenceEquals(null, volume)) { return; } volume.resolutionMode = UseHighQualityResolution.Value ? LightProbeProxyVolume.ResolutionMode.Automatic : LightProbeProxyVolume.ResolutionMode.Custom; if (UseHighQualityResolution.Value) { volume.probeDensity = Mathf.Clamp(ProxyProbeDensity.Value, 0.01f, 1f); } else { volume.gridResolutionX = ProxyProbeResolution.Value; volume.gridResolutionY = ProxyProbeResolution.Value; volume.gridResolutionZ = ProxyProbeResolution.Value; } }
public static int set_refreshMode(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); LightProbeProxyVolume.RefreshMode refreshMode; LuaObject.checkEnum <LightProbeProxyVolume.RefreshMode>(l, 2, out refreshMode); lightProbeProxyVolume.refreshMode = refreshMode; LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
private void DoBoxEditing() { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)base.target; using (new Handles.DrawingScope(lightProbeProxyVolume.transform.localToWorldMatrix)) { this.m_BoundsHandle.center = lightProbeProxyVolume.originCustom; this.m_BoundsHandle.size = lightProbeProxyVolume.sizeCustom; EditorGUI.BeginChangeCheck(); this.m_BoundsHandle.DrawHandle(); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(lightProbeProxyVolume, "Modified Light Probe Proxy Volume AABB"); lightProbeProxyVolume.originCustom = this.m_BoundsHandle.center; lightProbeProxyVolume.sizeCustom = this.m_BoundsHandle.size; EditorUtility.SetDirty(base.target); } } }
public static int set_probeDensity(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); float probeDensity; LuaObject.checkType(l, 2, out probeDensity); lightProbeProxyVolume.probeDensity = probeDensity; LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static int set_gridResolutionZ(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); int gridResolutionZ; LuaObject.checkType(l, 2, out gridResolutionZ); lightProbeProxyVolume.gridResolutionZ = gridResolutionZ; LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
internal void RenderLightProbeProxyVolumeWarningNote(Renderer renderer, int selectionCount) { if (this.IsUsingLightProbeProxyVolume(selectionCount)) { if (LightProbeProxyVolume.isFeatureSupported) { LightProbeProxyVolume component = renderer.GetComponent <LightProbeProxyVolume>(); bool flag = renderer.lightProbeProxyVolumeOverride == null || renderer.lightProbeProxyVolumeOverride.GetComponent <LightProbeProxyVolume>() == null; if (component == null && flag) { EditorGUILayout.HelpBox(this.m_LightProbeVolumeNote.text, MessageType.Warning); } } else { EditorGUILayout.HelpBox(this.m_LightProbeVolumeUnsupportedNote.text, MessageType.Warning); } } }
public static int set_sizeCustom(IntPtr l) { int result; try { LightProbeProxyVolume lightProbeProxyVolume = (LightProbeProxyVolume)LuaObject.checkSelf(l); Vector3 sizeCustom; LuaObject.checkType(l, 2, out sizeCustom); lightProbeProxyVolume.sizeCustom = sizeCustom; LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
internal void RenderLightProbeProxyVolumeWarningNote(Renderer renderer, int selectionCount) { if (IsUsingLightProbeProxyVolume(selectionCount)) { if (LightProbeProxyVolume.isFeatureSupported && SupportedRenderingFeatures.active.lightProbeProxyVolumes) { LightProbeProxyVolume lightProbeProxyVol = renderer.GetComponent <LightProbeProxyVolume>(); bool invalidProxyVolumeOverride = (renderer.lightProbeProxyVolumeOverride == null) || (renderer.lightProbeProxyVolumeOverride.GetComponent <LightProbeProxyVolume>() == null); if (lightProbeProxyVol == null && invalidProxyVolumeOverride && LightProbes.AreLightProbesAllowed(renderer)) { EditorGUILayout.HelpBox(m_LightProbeVolumeNote.text, MessageType.Warning); } } else { EditorGUILayout.HelpBox(m_LightProbeVolumeUnsupportedNote.text, MessageType.Warning); } } }
internal void DrawSelectedProbes() { if (!ShouldDrawGizmos(this)) { return; } OnValidate(); int layer = 0; Material material = m_DebugMaterial; if (!material) { return; } material.enableInstancing = true; Mesh mesh = m_DebugMesh; if (!mesh) { return; } int submeshIndex = 0; MaterialPropertyBlock properties = null; ShadowCastingMode castShadows = ShadowCastingMode.Off; bool receiveShadows = false; Camera emptyCamera = null; LightProbeUsage lightProbeUsage = LightProbeUsage.Off; LightProbeProxyVolume lightProbeProxyVolume = null; foreach (Matrix4x4[] matrices in m_DebugProbeMatricesList) { Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, matrices.Length, properties, castShadows, receiveShadows, layer, emptyCamera, lightProbeUsage, lightProbeProxyVolume); } }
static void RenderBoxGizmo(LightProbeProxyVolume probeProxyVolume, GizmoType gizmoType) { if (s_LastInteractedEditor == null) { return; } if (s_LastInteractedEditor.sceneViewEditing && EditMode.editMode == EditMode.SceneViewEditMode.LightProbeProxyVolumeBox) { Color oldColor = Gizmos.color; Gizmos.color = kGizmoLightProbeProxyVolumeColor; Vector3 position = probeProxyVolume.originCustom; Matrix4x4 oldMatrix = Gizmos.matrix; Gizmos.matrix = probeProxyVolume.transform.localToWorldMatrix; Gizmos.DrawCube(position, -1f * probeProxyVolume.sizeCustom); Gizmos.matrix = oldMatrix; Gizmos.color = oldColor; } }
void DoBoxEditing() { // Drawing of the probe box is done from GizmoDrawers.cpp, // here we only want to show the box editing handles when needed. LightProbeProxyVolume proxyVolume = (LightProbeProxyVolume)target; using (new Handles.DrawingScope(proxyVolume.transform.localToWorldMatrix)) { m_BoundsHandle.center = proxyVolume.originCustom; m_BoundsHandle.size = proxyVolume.sizeCustom; EditorGUI.BeginChangeCheck(); m_BoundsHandle.DrawHandle(); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(proxyVolume, "Modified Light Probe Proxy Volume AABB"); proxyVolume.originCustom = m_BoundsHandle.center; proxyVolume.sizeCustom = m_BoundsHandle.size; EditorUtility.SetDirty(target); } } }
private void onSpawnCrowd() { //Create type of customer from range 0 to type 4 GameObject Spawner = ObjectPool.Instance.GetPooledObject(People_1[Random.Range(0, 4)]); //if (Reversed) //if the custoemr move from opposite they will walk from reverse directions if (Spawner.transform.forward.z != gameObject.transform.forward.z) { Spawner.transform.forward = Vector3.RotateTowards(Spawner.transform.forward, gameObject.transform.forward, Mathf.PI, 0.0f); } //Change of their lighting so they won't be dark in color MeshRenderer renderer = Spawner.GetComponent <MeshRenderer>(); renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; LightProbeProxyVolume proxy = Spawner.GetComponent <LightProbeProxyVolume>(); Destroy(proxy); //create human from positions Spawner.transform.position = C_Spawner.transform.position; }
internal bool HasValidLightProbeProxyVolumeOverride(Renderer renderer, int selectionCount) { LightProbeProxyVolume lightProbeProxyVolume = (!(renderer.lightProbeProxyVolumeOverride != null)) ? null : renderer.lightProbeProxyVolumeOverride.GetComponent <LightProbeProxyVolume>(); return(this.IsUsingLightProbeProxyVolume(selectionCount) && (lightProbeProxyVolume == null || lightProbeProxyVolume.boundingBoxMode != LightProbeProxyVolume.BoundingBoxMode.AutomaticLocal)); }
private static IEnumerator WaitUntilOtherProcess(LightProbeProxyVolume volume) { yield return(new WaitForSecondsRealtime(.5f)); Configs.UpdateRenderers(volume); }