Пример #1
0
        partial void OnClicked(int component)
        {
            Vector3Distribution distribution = Value;

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

                        curves[component] = curve;

                        Vector3Curve compoundCurve = AnimationUtility.CombineCurve3D(curves);
                        Value = new Vector3Distribution(compoundCurve);
                        OnChanged?.Invoke();
                        OnConfirmed?.Invoke();
                    });
                }
            }
            else if (DistributionType == PropertyDistributionType.RandomCurveRange)
            {
                AnimationCurve[] minCurves = AnimationUtility.SplitCurve3D(distribution.GetMinCurve());
                AnimationCurve[] maxCurves = AnimationUtility.SplitCurve3D(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;

                        Vector3Curve minCompoundCurves = AnimationUtility.CombineCurve3D(minCurves);
                        Vector3Curve maxCompoundCurves = AnimationUtility.CombineCurve3D(maxCurves);

                        Value = new Vector3Distribution(minCompoundCurves, maxCompoundCurves);
                        OnChanged?.Invoke();
                        OnConfirmed?.Invoke();
                    });
                }
            }
        }
Пример #2
0
 private static extern void Internal_TDistribution3(Vector3Distribution managedInstance, Vector3Curve minCurve, Vector3Curve maxCurve);
Пример #3
0
 private static extern void Internal_TDistribution2(Vector3Distribution managedInstance, Vector3Curve curve);
Пример #4
0
 private static extern void Internal_TDistribution1(Vector3Distribution managedInstance, ref Vector3 minValue, ref Vector3 maxValue);
Пример #5
0
 private static extern void Internal_TDistribution0(Vector3Distribution managedInstance, ref Vector3 value);
Пример #6
0
 private static extern void Internal_TDistribution(Vector3Distribution managedInstance);
Пример #7
0
 private static extern void Internal_setInitialRotation3D(IntPtr thisPtr, Vector3Distribution value);
Пример #8
0
 private static extern void Internal_setValue(IntPtr thisPtr, Vector3Distribution value);