Ejemplo n.º 1
0
    private void Start()
    {
        /* Adding components using code, simply because it's more friendly to version control */
        handDraggable = gameObject.AddComponent <HandDraggable>();
        handDraggable.RotationMode = HandDraggable.RotationModeEnum.LockObjectRotation;
        GetComponent <TwoHandManipulatable>().enabled = false;

        ModelClipPlaneCtrl = ModelClipPlane.GetComponentInChildren <ModelClippingPlaneControl>();
        // Turn off the clipping plane on start
        DefaultModelMaterial.DisableKeyword("CLIPPING_ON");
        DefaultModelTransparentMaterial.DisableKeyword("CLIPPING_ON");
        DataVisualizationMaterial.DisableKeyword("CLIPPING_ON");

        LayersSection.SetActive(false);
        AnimationSubmenu.SetActive(false);

        RefreshUserInterface();
        InitializeAddButtons();

        // This sets proper state of buttons and components like handDraggable
        ClickChangeTransformationState(TransformationState.None);

        // Animation speed slider
        SliderAnimationSpeed.GetComponent <SliderGestureControl>().OnUpdateEvent.AddListener(
            delegate {
            AnimationSpeed = SliderAnimationSpeed.GetComponent <SliderGestureControl>().SliderValue;
        }
            );
    }
Ejemplo n.º 2
0
    private void Start()
    {
        GetComponent <ObjectManipulator>().enabled = false;

        ModelClipPlaneCtrl   = ModelClipPlane.GetComponentInChildren <ModelClippingPlaneControl>();
        directionalIndicator = gameObject.GetComponentInChildren <DirectionalIndicator>();
        // Turn off the clipping plane on start
        DefaultModelMaterial.DisableKeyword("CLIPPING_ON");
        DefaultModelTransparentMaterial.DisableKeyword("CLIPPING_ON");
        DataVisualizationMaterial.DisableKeyword("CLIPPING_ON");

        LayerSubmenuState     = false;
        AnimationSpeedSubmenu = false;

        RefreshUserInterface();
        InitializeAddButtons();

        // This sets proper state of buttons and components like handDraggable
        ChangeTransformationState(TransformationState.None);

        SliderAnimationSpeed.GetComponent <PinchSlider>().OnValueUpdated.AddListener(
            delegate
        {
            AnimationSpeed = SliderAnimationSpeed.GetComponent <PinchSlider>().SliderValue *SliderSpeedFactor;
            Debug.Log(SliderAnimationSpeed.GetComponent <PinchSlider>().SliderValue.ToString());
            SliderAnimationSpeed.transform.Find("ThumbRoot/SpeedValue").GetComponent <TextMeshPro>().text = Math.Round(AnimationSpeed, 2).ToString();
        }
            );
    }
Ejemplo n.º 3
0
    void Start()
    {
        ModelManager       = gameObject.GetComponent <ModelWithPlate>();;
        ClipPlaneManager   = ModelManager.ModelClipPlane.GetComponent <ModelClippingPlaneControl>();
        ColorMapManager    = gameObject.GetComponent <ColorMap>();
        hostInstanceName   = ModelManager.InstanceName;
        hostInstanceLayers = ModelManager.InstanceLayers;
        hostPlatePosition  = transform.localPosition;
        hostPlateScale     = transform.localScale;

        hostClippingPlaneActive   = ClipPlaneManager.ClippingPlaneState != ModelClippingPlaneControl.ClipPlaneState.Disabled;
        hostClippingPlanePosition = ModelManager.ModelClipPlane.transform.localPosition;
        hostClippingPlaneRotation = ModelManager.ModelClipPlane.transform.localRotation;
        hostColorMap = ColorMapManager.MapName;
        singleton    = this;
    }