Example #1
0
 internal BoxDisplay(BoxDisplayConfiguration configuration)
 {
     Debug.Assert(configuration != null, "Can't create BoundsControlBoxDisplay without valid configuration");
     config = configuration;
     config.flattenAxisScaleChanged.AddListener(UpdateDisplayWithCache);
     config.materialChanged.AddListener(UpdateBoxDisplayMaterial);
 }
        private void Awake()
        {
            if (targetObject == null)
            {
                targetObject = gameObject;
            }

            // ensure we have a default configuration in case there's none set by the user
            scaleHandlesConfiguration          = EnsureScriptable(scaleHandlesConfiguration);
            rotationHandlesConfiguration       = EnsureScriptable(rotationHandlesConfiguration);
            boxDisplayConfiguration            = EnsureScriptable(boxDisplayConfiguration);
            linksConfiguration                 = EnsureScriptable(linksConfiguration);
            handleProximityEffectConfiguration = EnsureScriptable(handleProximityEffectConfiguration);

            // instantiate runtime classes for visuals
            scaleHandles    = new ScaleHandles(scaleHandlesConfiguration);
            rotationHandles = new RotationHandles(rotationHandlesConfiguration);
            boxDisplay      = new BoxDisplay(boxDisplayConfiguration);
            links           = new Links(linksConfiguration);
            proximityEffect = new ProximityEffect(handleProximityEffectConfiguration);

            // subscribe to visual changes
            scaleHandlesConfiguration.configurationChanged.AddListener(CreateRig);
            scaleHandlesConfiguration.visibilityChanged.AddListener(ResetVisuals);
            rotationHandlesConfiguration.configurationChanged.AddListener(CreateRig);
            boxDisplayConfiguration.configurationChanged.AddListener(CreateRig);
            linksConfiguration.configurationChanged.AddListener(CreateRig);
        }
Example #3
0
 internal BoxDisplay(BoxDisplayConfiguration configuration)
 {
     Debug.Assert(configuration != null, "Can't create BoundsControlBoxDisplay without valid configuration");
     config = configuration;
 }