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; } }
protected override void Start() { if (!Application.Current.IsEditor) { materials = new Material[] { material0, material1, material2, material3 }; materialComponent.Material = material0; string[] nodesWithButtons = { "PressableButtons", "PressableButtonsSharedPlate", "PressableButtonsSharedPlate40x40mm" }; foreach (string nodeName in nodesWithButtons) { Entity buttonsParent = this.Owner.Parent.Find(nodeName); foreach (PressableButton b in buttonsParent.FindComponentsInChildren <PressableButton>()) { b.ButtonPressed += OnButtonPressed; //Update text based on scale Text3D text3d = b.Owner.FindComponentInChildren <Text3D>(); if (text3d != null) { text3d.Text = string.Format("{0}x{0}mm", 32.0f * b.Owner.FindComponent <Transform3D>().Scale.X); } } } } }