コード例 #1
0
        // Region if min and max is valid, Curve if min is null
        public CurveData(string name, GUIContent displayName, SerializedProperty min, SerializedProperty max, Color color, bool signedRange,
                         CurveWrapper.GetAxisScalarsCallback getAxisScalars, CurveWrapper.SetAxisScalarsCallback setAxisScalars, bool visible)
        {
            m_UniqueName  = name;
            m_DisplayName = displayName;
            m_SignedRange = signedRange;

            m_Min = min;
            m_Max = max;
            if (m_Min != null)
            {
                m_MinId = ++s_IdCounter;
            }
            if (m_Max != null)
            {
                m_MaxId = ++s_IdCounter;
            }
            m_Color = color;
            m_GetAxisScalarsCallback = getAxisScalars;
            m_SetAxisScalarsCallback = setAxisScalars;
            m_Visible = visible;

            if (m_Max == null || m_MaxId == 0)
            {
                Debug.LogError("Max curve should always be valid! (Min curve can be null)");
            }
        }
コード例 #2
0
 public CurveData(string name, GUIContent displayName, SerializedProperty min, SerializedProperty max, Color color, bool signedRange, CurveWrapper.GetAxisScalarsCallback getAxisScalars, CurveWrapper.SetAxisScalarsCallback setAxisScalars, bool visible)
 {
     this.m_UniqueName  = name;
     this.m_DisplayName = displayName;
     this.m_SignedRange = signedRange;
     this.m_Min         = min;
     this.m_Max         = max;
     if (this.m_Min != null)
     {
         this.m_MinId = ++ParticleSystemCurveEditor.CurveData.s_IdCounter;
     }
     if (this.m_Max != null)
     {
         this.m_MaxId = ++ParticleSystemCurveEditor.CurveData.s_IdCounter;
     }
     this.m_Color = color;
     this.m_GetAxisScalarsCallback = getAxisScalars;
     this.m_SetAxisScalarsCallback = setAxisScalars;
     this.m_Visible = visible;
     if (this.m_Max != null && this.m_MaxId != 0)
     {
         return;
     }
     Debug.LogError((object)"Max curve should always be valid! (Min curve can be null)");
 }
コード例 #3
0
 public CurveWrapper()
 {
     this.id        = 0;
     this.groupId   = -1;
     this.regionId  = -1;
     this.hidden    = false;
     this.readOnly  = false;
     this.listIndex = -1;
     this.getAxisUiScalarsCallback = null;
     this.setAxisUiScalarsCallback = null;
 }
コード例 #4
0
		public CurveWrapper()
		{
			this.id = 0;
			this.groupId = -1;
			this.regionId = -1;
			this.hidden = false;
			this.readOnly = false;
			this.listIndex = -1;
			this.getAxisUiScalarsCallback = null;
			this.setAxisUiScalarsCallback = null;
		}
コード例 #5
0
		public CurveData(string name, GUIContent displayName, SerializedProperty min, SerializedProperty max, Color color, bool signedRange, CurveWrapper.GetAxisScalarsCallback getAxisScalars, CurveWrapper.SetAxisScalarsCallback setAxisScalars, bool visible)
		{
			this.m_UniqueName = name;
			this.m_DisplayName = displayName;
			this.m_SignedRange = signedRange;
			this.m_Min = min;
			this.m_Max = max;
			if (this.m_Min != null)
			{
				this.m_MinId = ++ParticleSystemCurveEditor.CurveData.s_IdCounter;
			}
			if (this.m_Max != null)
			{
				this.m_MaxId = ++ParticleSystemCurveEditor.CurveData.s_IdCounter;
			}
			this.m_Color = color;
			this.m_GetAxisScalarsCallback = getAxisScalars;
			this.m_SetAxisScalarsCallback = setAxisScalars;
			this.m_Visible = visible;
			if (this.m_Max == null || this.m_MaxId == 0)
			{
				Debug.LogError("Max curve should always be valid! (Min curve can be null)");
			}
		}
コード例 #6
0
    private CurveWrapper CreateCurveWrapper(SerializedProperty curve, int id, int regionId, Color color, bool signedRange, CurveWrapper.GetAxisScalarsCallback getAxisScalarsCallback, CurveWrapper.SetAxisScalarsCallback setAxisScalarsCallback)
    {
        CurveWrapper curveWrapper = new CurveWrapper();

        curveWrapper.id       = id;
        curveWrapper.regionId = regionId;
        curveWrapper.color    = color;
        curveWrapper.renderer = new NormalCurveRenderer(curve.animationCurveValue);
        curveWrapper.renderer.SetWrap(curve.animationCurveValue.preWrapMode, curve.animationCurveValue.postWrapMode);
        if (curveWrapper.curve.keys.Length == 1)
        {
            curveWrapper.renderer.SetCustomRange(0f, 1f);
            curveWrapper.wrapColorMultiplier = Color.clear;
        }
        else
        {
            curveWrapper.renderer.SetCustomRange(0f, 0f);
            curveWrapper.wrapColorMultiplier = color;
        }
        curveWrapper.vRangeMin = ((!signedRange) ? 0f : -1f);
        curveWrapper.getAxisUiScalarsCallback = getAxisScalarsCallback;
        curveWrapper.setAxisUiScalarsCallback = setAxisScalarsCallback;
        return(curveWrapper);
    }
コード例 #7
0
    private CurveWrapper CreateCurveWrapper(SerializedProperty curve, int id, int regionId, Color color, bool signedRange, CurveWrapper.GetAxisScalarsCallback getAxisScalarsCallback, CurveWrapper.SetAxisScalarsCallback setAxisScalarsCallback)
    {
        float        end          = 1f;
        CurveWrapper curveWrapper = new CurveWrapper();

        curveWrapper.id       = id;
        curveWrapper.regionId = regionId;
        curveWrapper.color    = color;
        curveWrapper.renderer = (CurveRenderer) new NormalCurveRenderer(curve.animationCurveValue);
        curveWrapper.renderer.SetCustomRange(0.0f, end);
        curveWrapper.vRangeMin = !signedRange ? 0.0f : -1f;
        curveWrapper.getAxisUiScalarsCallback = getAxisScalarsCallback;
        curveWrapper.setAxisUiScalarsCallback = setAxisScalarsCallback;
        return(curveWrapper);
    }
コード例 #8
0
    CurveWrapper CreateCurveWrapper(SerializedProperty curve, int id, int regionId, Color color, bool signedRange,
                                    CurveWrapper.GetAxisScalarsCallback getAxisScalarsCallback, CurveWrapper.SetAxisScalarsCallback setAxisScalarsCallback)
    {
        CurveWrapper cw = new CurveWrapper();

        cw.id       = id;
        cw.regionId = regionId;
        cw.color    = color;
        cw.renderer = new NormalCurveRenderer(curve.animationCurveValue);
        cw.renderer.SetWrap(curve.animationCurveValue.preWrapMode, curve.animationCurveValue.postWrapMode);
        if (cw.curve.keys.Length == 1)
        {
            cw.renderer.SetCustomRange(0.0f, 1.0f);
            cw.wrapColorMultiplier = Color.clear; // Hide wrapping when we only have 1 key
        }
        else
        {
            cw.renderer.SetCustomRange(0.0f, 0.0f);
            cw.wrapColorMultiplier = color;
        }
        cw.vRangeMin = signedRange ? -1.0F : 0.0F;
        cw.getAxisUiScalarsCallback = getAxisScalarsCallback;
        cw.setAxisUiScalarsCallback = setAxisScalarsCallback;
        return(cw);
    }