partial void OnClicked(int component)
        {
            Vector2Distribution distribution = Value;

            if (DistributionType == PropertyDistributionType.Curve)
            {
                AnimationCurve[] curves = AnimationUtility.SplitCurve2D(distribution.GetMinCurve());
                if (component < curves.Length)
                {
                    CurveEditorWindow.Show(curves[component], (success, curve) =>
                    {
                        if (!success)
                        {
                            return;
                        }

                        curves[component] = curve;

                        Vector2Curve compoundCurve = AnimationUtility.CombineCurve2D(curves);
                        Value = new Vector2Distribution(compoundCurve);
                        OnChanged?.Invoke();
                        OnConfirmed?.Invoke();
                    });
                }
            }
            else if (DistributionType == PropertyDistributionType.RandomCurveRange)
            {
                AnimationCurve[] minCurves = AnimationUtility.SplitCurve2D(distribution.GetMinCurve());
                AnimationCurve[] maxCurves = AnimationUtility.SplitCurve2D(distribution.GetMaxCurve());

                if (component < minCurves.Length && component < maxCurves.Length)
                {
                    CurveEditorWindow.Show(minCurves[component], maxCurves[component],
                                           (success, minCurve, maxCurve) =>
                    {
                        if (!success)
                        {
                            return;
                        }

                        minCurves[component] = minCurve;
                        maxCurves[component] = maxCurve;

                        Vector2Curve minCompoundCurves = AnimationUtility.CombineCurve2D(minCurves);
                        Vector2Curve maxCompoundCurves = AnimationUtility.CombineCurve2D(maxCurves);

                        Value = new Vector2Distribution(minCompoundCurves, maxCompoundCurves);
                        OnChanged?.Invoke();
                        OnConfirmed?.Invoke();
                    });
                }
            }
        }
Ejemplo n.º 2
0
 private static extern void Internal_TDistribution3(Vector2Distribution managedInstance, Vector2Curve minCurve, Vector2Curve maxCurve);
Ejemplo n.º 3
0
 private static extern void Internal_TDistribution2(Vector2Distribution managedInstance, Vector2Curve curve);
Ejemplo n.º 4
0
 private static extern void Internal_TDistribution1(Vector2Distribution managedInstance, ref Vector2 minValue, ref Vector2 maxValue);
Ejemplo n.º 5
0
 private static extern void Internal_TDistribution0(Vector2Distribution managedInstance, ref Vector2 value);
Ejemplo n.º 6
0
 private static extern void Internal_TDistribution(Vector2Distribution managedInstance);
 private static extern void Internal_setValue(IntPtr thisPtr, Vector2Distribution value);
Ejemplo n.º 8
0
 private static extern void Internal_setsizeScaleOverLifetime(IntPtr thisPtr, Vector2Distribution value);