Exemple #1
0
        // Sync ProBuilder HandleOrientation to the current Tools.PivotRotation
        static void SyncPivotRotation()
        {
            if (s_PivotRotation != Tools.pivotRotation)
            {
                s_HandleOrientation.SetValue(Tools.pivotRotation == PivotRotation.Global
                    ? HandleOrientation.World
                    : HandleOrientation.ActiveObject);
                s_PivotRotation = Tools.pivotRotation;
                MeshSelection.InvalidateCaches();
                return;
            }

            var value = s_HandleOrientation.value;
            var unity = value == HandleOrientation.ActiveObject ? PivotRotation.Local : PivotRotation.Global;

            if (value != HandleOrientation.ActiveElement)
            {
                if (unity != Tools.pivotRotation)
                {
                    s_HandleOrientation.SetValue(Tools.pivotRotation == PivotRotation.Global
                            ? HandleOrientation.World
                            : HandleOrientation.ActiveObject,
                                                 true);
                    MeshSelection.InvalidateCaches();
                }
            }
        }
Exemple #2
0
        static void SyncPivotPoint()
        {
            var unityPivot = s_PivotPoint.value == PivotPoint.Center ? PivotMode.Center : PivotMode.Pivot;

            if (Tools.pivotMode != unityPivot)
            {
                s_PivotPoint.SetValue(Tools.pivotMode == PivotMode.Center ? PivotPoint.Center : s_PivotModePivotEquivalent.value, true);
                MeshSelection.InvalidateCaches();
            }
        }
 protected override void OnToolEngaged()
 {
     MeshSelection.InvalidateCaches();
 }