private bool guiSlider(float margin, DirtyValue dirtyValue) { var val = dirtyValue.Value; GUILayout.BeginHorizontal(); try { GUILayout.Label(dirtyValue.Name, uiParams.lStyle, GUILayout.Width(64)); GUILayout.Label(val.ToString("F0"), uiParams.lStyle, GUILayout.Width(32)); GUILayout.BeginVertical(); GUILayout.Space(margin * 5f); val = GUILayout.HorizontalSlider(val, dirtyValue.Min, dirtyValue.Max); GUILayout.EndVertical(); GUILayout.Space(margin * 3); } finally { GUILayout.EndHorizontal(); } if (NumberUtil.Equals(dirtyValue.Value, val)) { return(false); } dirtyValue.Value = val; return(true); }
//value public void SetValue <T>(string key, T value) where T : struct { if (m_DirtyFields[key] == null) { m_DirtyFields[key] = new DirtyValue <T>(value); } ((DirtyValue <T>)m_DirtyFields[key]).SetValue(value); }
public bool IsValueDirty <T>(string key) where T : struct { if (m_DirtyFields[key] == null) { m_DirtyFields[key] = new DirtyValue <T>(default(T)); } return(((DirtyValue <T>)m_DirtyFields[key]).IsDirty()); }
public T GetOriginalValue <T>(string key) where T : struct { if (m_DirtyFields[key] == null) { m_DirtyFields[key] = new DirtyValue <T>(default(T)); } return(((DirtyValue <T>)m_DirtyFields[key]).OriginalValue); }
public FilterParam(FilterParam filter) { Dirty = new DirtyFlag(); Hue = new DirtyValue(Dirty, HueRange, filter.Hue.Value); Saturation = new DirtyValue(Dirty, SaturRange, filter.Saturation.Value); Lightness = new DirtyValue(Dirty, LightRange, filter.Lightness.Value); InputMin = new DirtyValue(Dirty, InpMinRange, filter.InputMin.Value); InputMax = new DirtyValue(Dirty, InpMaxRange, filter.InputMax.Value); InputMid = new DirtyValue(Dirty, InpMidRange, filter.InputMid.Value); OutputMin = new DirtyValue(Dirty, OutMinRange, filter.OutputMin.Value); OutputMax = new DirtyValue(Dirty, OutMaxRange, filter.OutputMax.Value); }
public FilterParam() { Dirty = new DirtyFlag(); Hue = new DirtyValue(Dirty, HueRange, HueRange.Min); Saturation = new DirtyValue(Dirty, SaturRange, SaturRange.Max * 0.5f); Lightness = new DirtyValue(Dirty, LightRange, LightRange.Max * 0.5f); InputMin = new DirtyValue(Dirty, InpMinRange, InpMinRange.Min); InputMax = new DirtyValue(Dirty, InpMaxRange, InpMaxRange.Max); InputMid = new DirtyValue(Dirty, InpMidRange, InpMidRange.Max * 0.5f); OutputMin = new DirtyValue(Dirty, OutMinRange, OutMinRange.Min); OutputMax = new DirtyValue(Dirty, OutMaxRange, OutMaxRange.Max); }
public void Clear() { Dirty = new DirtyFlag(); Hue = new DirtyValue(Dirty, "色相", 0f, 0f, 360f); Saturation = new DirtyValue(Dirty, "彩度", 100f, 0f, 200f); Lightness = new DirtyValue(Dirty, "明度", 100f, 0f, 200f); InputMin = new DirtyValue(Dirty, "InpMin", 0f, 0f, 100f); InputMax = new DirtyValue(Dirty, "InpMax", 100f, 0f, 100f); InputMid = new DirtyValue(Dirty, "InpMid", 50f, 0f, 100f); OutputMin = new DirtyValue(Dirty, "OutMin", 0f, 0f, 100f); OutputMax = new DirtyValue(Dirty, "OutMax", 100f, 0f, 100f); }
private static void guiSlider(float margin, DirtyValue dirtyValue) { float val = dirtyValue.Value; GUILayout.BeginHorizontal(); GUILayout.Label(dirtyValue.Name, GUILayout.Width(64)); GUILayout.Label(string.Format("{0:F0}", val), GUILayout.Width(32)); val = GUILayout.HorizontalSlider(val, dirtyValue.Min, dirtyValue.Max); GUILayout.Space(margin * 2f); GUILayout.EndHorizontal(); dirtyValue.Value = val; }
static void StaticReset() { s_packetsSentThisFrame = 0; s_currentUnityFrame = default; s_cachedPacketData = new byte[Transfers.PAQUET_BYTE_ARRAY_SIZE]; }
private bool guiSlider(float margin, DirtyValue dirtyValue) { float val = dirtyValue.Value; GUILayout.BeginHorizontal(); try { GUILayout.Label(dirtyValue.Name, uiParams.lStyle, GUILayout.Width(64)); GUILayout.Label(val.ToString("F0"), uiParams.lStyle, GUILayout.Width(32)); GUILayout.BeginVertical(); GUILayout.Space(margin*5f); val = GUILayout.HorizontalSlider(val, dirtyValue.Min, dirtyValue.Max ); GUILayout.EndVertical(); GUILayout.Space(margin *3); } finally { GUILayout.EndHorizontal(); } if (!NumberUtil.Equals(dirtyValue.Value, val)) { dirtyValue.Value = val; return true; } return false; }
public FilterParam() { Dirty = new DirtyFlag(); Hue = new DirtyValue(Dirty, HueRange, HueRange.Min); Saturation = new DirtyValue(Dirty, SaturRange, SaturRange.Max*0.5f); Lightness = new DirtyValue(Dirty, LightRange, LightRange.Max*0.5f); InputMin = new DirtyValue(Dirty, InpMinRange, InpMinRange.Min); InputMax = new DirtyValue(Dirty, InpMaxRange, InpMaxRange.Max); InputMid = new DirtyValue(Dirty, InpMidRange, InpMidRange.Max*0.5f); OutputMin = new DirtyValue(Dirty, OutMinRange, OutMinRange.Min); OutputMax = new DirtyValue(Dirty, OutMaxRange, OutMaxRange.Max); }