protected override void Start()
        {
            if (Application.Current.IsEditor)
            {
                return;
            }

            materialDecorator = new HoloGraphic(materialComponent.Material);

            this.pinchSliders[0] = pinchSliderPrefabR.Owner.FindComponentInChildren <PinchSlider>();
            this.pinchSliders[1] = pinchSliderPrefabG.Owner.FindComponentInChildren <PinchSlider>();
            this.pinchSliders[2] = pinchSliderPrefabB.Owner.FindComponentInChildren <PinchSlider>();

            string[] titles = { "Red", "Green", "Blue" };
            for (int i = 0; i < 3; ++i)
            {
                PinchSlider p     = pinchSliders[i];
                Entity      title = p.Owner.FindChild("Title", true);
                if (title != null)
                {
                    Text3D text = title.FindComponent <Text3D>();
                    if (text != null)
                    {
                        text.Text = titles[i];
                    }
                }

                p.InitialValue  = materialDecorator.Parameters_Color[i];
                p.SliderValue   = materialDecorator.Parameters_Color[i];
                p.ValueUpdated += this.P_ValueUpdated;
            }
        }
        /// <inheritdoc/>
        protected override void Start()
        {
            this.slateDecorator = new HoloGraphic(this.materialComponent.Material);

            if (!Application.Current.IsEditor)
            {
                this.nearInteractionTouchable = this.Owner.GetOrAddComponent <NearInteractionTouchable>();
                this.soundEmitter             = this.Owner.GetOrAddComponent <SoundEmitter3D>();
                this.Owner.GetOrAddComponent <StaticBody3D>();
                this.Owner.GetInChildrenOrAddComponent <BoxCollider3D>();
            }
        }
        protected override bool OnAttached()
        {
            if (!base.OnAttached())
            {
                return(false);
            }

            if (!HoloGraphic.IsHolographicMaterial(this.materialComponent.Material))
            {
                throw new InvalidOperationException($"Material component material should be {nameof(HoloGraphic)}.");
            }

            this.material     = new HoloGraphic(this.materialComponent.Material);
            this.initialColor = this.material.Albedo;

            if (this.pressableButton != null)
            {
                this.pressableButton.ButtonPressed  += this.PressableButton_ButtonPressed;
                this.pressableButton.ButtonReleased += this.PressableButton_ButtonReleased;
            }

            if (this.pinchSlider != null)
            {
                this.pinchSlider.ValueUpdated += this.PinchSlider_ValueUpdated;
            }

            if (this.simpleManipulationHandler != null)
            {
                this.simpleManipulationHandler.ManipulationStarted += SimpleManipulationHandler_ManipulationStarted;
                this.simpleManipulationHandler.ManipulationEnded   += SimpleManipulationHandler_ManipulationEnded;
            }

            if (this.boxColliderRenderer != null)
            {
                this.boxColliderRenderer.IsEnabled = false;
            }

            return(true);
        }
        protected override void Start()
        {
            if (Application.Current.IsEditor)
            {
                return;
            }

            this.materialDecorator = new HoloGraphic(materialComponent.Material);

            this.pinchSliders[0] = this.pinchSliderPrefabR.FindComponentInChildren <PinchSlider>();
            this.pinchSliders[1] = this.pinchSliderPrefabG.FindComponentInChildren <PinchSlider>();
            this.pinchSliders[2] = this.pinchSliderPrefabB.FindComponentInChildren <PinchSlider>();

            for (int i = 0; i < 3; ++i)
            {
                var p = pinchSliders[i];

                p.InitialValue  = this.materialDecorator.Parameters_Color[i];
                p.SliderValue   = this.materialDecorator.Parameters_Color[i];
                p.ValueUpdated += this.PinchSlider_ValueUpdated;
            }
        }
示例#5
0
 protected override void Start()
 {
     materialDecorator = new HoloGraphic(materialComponent.Material);
 }
示例#6
0
 protected override void Start()
 {
     cursorManager     = Owner.Scene.Managers.FindManager <CursorManager>();
     materialDecorator = new HoloGraphic(materialComponent.Material);
 }