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);
        }
 internal ScaleHandles(ScaleHandlesConfiguration configuration)
 {
     Debug.Assert(configuration != null, "Can't create BoundsControlScaleHandles without valid configuration");
     config = configuration;
 }
예제 #3
0
 internal ScaleHandles(ScaleHandlesConfiguration configuration)
 {
     Debug.Assert(configuration != null, "Can't create BoundsControlScaleHandles without valid configuration");
     config = configuration;
     config.handlesChanged.AddListener(HandlesChanged);
 }