private void DrawInternal(Rect rect, DoubleCurve doubleCurve) { if (doubleCurve == null) Debug.Log((object) "DoubleCurve is null"); else EditorGUIUtility.DrawRegionSwatch(rect, doubleCurve.maxCurve, doubleCurve.minCurve, new Color(0.8f, 0.8f, 0.8f, 1f), EditorGUI.kCurveBGColor, !doubleCurve.signedRange ? this.kUnsignedRange : this.kSignedRange); }
public override void Replace(int index, object newPresetObject) { DoubleCurve doubleCurve = newPresetObject as DoubleCurve; if (doubleCurve == null) { Debug.LogError("Wrong type used in DoubleCurvePresetLibrary"); return; } this.m_Presets[index].doubleCurve = doubleCurve; }
private void DrawInternal(Rect rect, DoubleCurve doubleCurve) { if (doubleCurve == null) { Debug.Log("DoubleCurve is null"); } else { EditorGUIUtility.DrawRegionSwatch(rect, doubleCurve.maxCurve, doubleCurve.minCurve, new Color(0.8f, 0.8f, 0.8f, 1f), EditorGUI.kCurveBGColor, !doubleCurve.signedRange ? this.kUnsignedRange : this.kSignedRange); } }
public override void Add(object presetObject, string presetName) { DoubleCurve doubleCurve = presetObject as DoubleCurve; if (doubleCurve == null) { Debug.LogError("Wrong type used in DoubleCurvePresetLibrary: Should be a DoubleCurve"); return; } this.m_Presets.Add(new DoubleCurvePresetLibrary.DoubleCurvePreset(doubleCurve, presetName)); }
private void DrawInternal(Rect rect, DoubleCurve doubleCurve) { if (doubleCurve == null) { Debug.Log("DoubleCurve is null"); return; } if (m_UseRanges) { EditorGUIUtility.DrawRegionSwatch(rect, doubleCurve.maxCurve, doubleCurve.minCurve, new Color(0.8f, 0.8f, 0.8f, 1.0f), EditorGUI.kCurveBGColor, doubleCurve.signedRange ? kSignedRange : kUnsignedRange); } else { EditorGUIUtility.DrawRegionSwatch(rect, doubleCurve.maxCurve, doubleCurve.minCurve, new Color(0.8f, 0.8f, 0.8f, 1.0f), EditorGUI.kCurveBGColor, kDefaultRange); } }
private void AddDefaultPresetsToLibrary(PresetLibrary presetLibrary) { DoubleCurvePresetLibrary curvePresetLibrary = presetLibrary as DoubleCurvePresetLibrary; if ((UnityEngine.Object)curvePresetLibrary == (UnityEngine.Object)null) { Debug.Log((object)("Incorrect preset library, should be a DoubleCurvePresetLibrary but was a " + (object)presetLibrary.GetType())); } else { bool signedRange = this.m_DoubleCurve.signedRange; List <DoubleCurve> doubleCurveList = new List <DoubleCurve>(); using (List <DoubleCurve> .Enumerator enumerator = (!this.IsSingleCurve(this.m_DoubleCurve) ? (!signedRange ? DoubleCurvePresetsContentsForPopupWindow.GetUnsignedDoubleCurveDefaults() : DoubleCurvePresetsContentsForPopupWindow.GetSignedDoubleCurveDefaults()) : DoubleCurvePresetsContentsForPopupWindow.GetUnsignedSingleCurveDefaults(signedRange)).GetEnumerator()) { while (enumerator.MoveNext()) { DoubleCurve current = enumerator.Current; curvePresetLibrary.Add((object)current, string.Empty); } } } }
public DoubleCurvePresetsContentsForPopupWindow(DoubleCurve doubleCurveToSave, System.Action <DoubleCurve> presetSelectedCallback) { m_DoubleCurve = doubleCurveToSave; m_PresetSelectedCallback = presetSelectedCallback; }
private bool IsSingleCurve(DoubleCurve doubleCurve) { return ((doubleCurve.minCurve == null) || (doubleCurve.minCurve.length == 0)); }
public DoubleCurvePresetsContentsForPopupWindow(DoubleCurve doubleCurveToSave, Action<DoubleCurve> presetSelectedCallback) { this.m_DoubleCurve = doubleCurveToSave; this.m_PresetSelectedCallback = presetSelectedCallback; }
public DoubleCurvePreset(DoubleCurve doubleCurvePreset, string presetName) { this.doubleCurve = doubleCurvePreset; this.name = presetName; }
private bool IsSingleCurve(DoubleCurve doubleCurve) { return((doubleCurve.minCurve == null) || (doubleCurve.minCurve.length == 0)); }
private bool IsSingleCurve(DoubleCurve doubleCurve) { if (doubleCurve.minCurve != null) return doubleCurve.minCurve.length == 0; return true; }
public DoubleCurvePreset(DoubleCurve doubleCurvePreset, string presetName) { doubleCurve = doubleCurvePreset; name = presetName; }
private void SetTopMostCurve(DoubleCurve doubleCurve) { int curveID; if (!this.m_CurveEditor.GetTopMostCurveID(out curveID)) return; for (int index = 0; index < this.m_AddedCurves.Count; ++index) { ParticleSystemCurveEditor.CurveData addedCurve = this.m_AddedCurves[index]; if (addedCurve.m_MaxId == curveID || addedCurve.m_MinId == curveID) { if (doubleCurve.signedRange == addedCurve.m_SignedRange) { if (addedCurve.m_MaxId > 0) this.SetCurve(this.m_CurveEditor.GetCurveFromID(addedCurve.m_MaxId), doubleCurve.maxCurve); if (addedCurve.m_MinId > 0) this.SetCurve(this.m_CurveEditor.GetCurveFromID(addedCurve.m_MinId), doubleCurve.minCurve); } else Debug.LogWarning((object) "Cannot assign a curves with different signed range"); } } }
bool IsSingleCurve(DoubleCurve doubleCurve) { return(doubleCurve.minCurve == null || doubleCurve.minCurve.length == 0); }
private void SetTopMostCurve(DoubleCurve doubleCurve) { int num; if (this.m_CurveEditor.GetTopMostCurveID(out num)) { for (int i = 0; i < this.m_AddedCurves.Count; i++) { CurveData data = this.m_AddedCurves[i]; if ((data.m_MaxId == num) || (data.m_MinId == num)) { if (doubleCurve.signedRange == data.m_SignedRange) { if (data.m_MaxId > 0) { this.SetCurve(this.m_CurveEditor.GetCurveFromID(data.m_MaxId), doubleCurve.maxCurve); } if (data.m_MinId > 0) { this.SetCurve(this.m_CurveEditor.GetCurveFromID(data.m_MinId), doubleCurve.minCurve); } } else { Debug.LogWarning("Cannot assign a curves with different signed range"); } } } } }
private bool IsSingleCurve(DoubleCurve doubleCurve) { return doubleCurve.minCurve == null || doubleCurve.minCurve.length == 0; }