Example #1
0
    void Start()
    {
        hologramControl = FindObjectOfType <HologramControl>();

        speedSlider.OnUpdateEvent.AddListener(hologramControl.SetSpeed);
        speedSlider.SetSliderValue(HologramControl.DefaultSpeed);

        scaleSlider.OnUpdateEvent.AddListener(hologramControl.SetScale);
        scaleSlider.SetSliderValue(HologramControl.DefaultScale);
    }
Example #2
0
    // Update is called in a regular timeline
    void FixedUpdate()
    {
        //write scale percentage on the button
        float scalePercentage = (targetObject.transform.localScale.x * 100.0f) / originalScale.x;

        buttonLabel.text = "Scale: " + Math.Round(scalePercentage).ToString() + "%";

        if (isScaling)
        {
            //change other scale option's value
            sliderGestureControl.SetSliderValue(scalePercentage - sliderGestureControl.MinSliderValue);
            UpdateHandScale();
        }
    }
Example #3
0
        protected override void stateChanged_internal(string state)
        {
            float value;

            try
            {
                value = float.Parse(state);
                //Debug.Log("Sliderbar changed: " + value);

                //put new value in
                sliderGestureControl.SetSliderValue(value);
            }
            catch (Exception e)
            {
                Debug.LogError("clould not parse " + state + " to float. Error: " + e.StackTrace);
                Debug.LogError(e.StackTrace);
                return;
            }
        }
Example #4
0
        private void Start()
        {
            float size = GetSize();

            SetSize(size);


            m_slider.SetSliderValue(size);
            m_slider.OnUpdateEvent.AddListener((sliderValue) =>
            {
                SetSize(sliderValue);

                if ((Time.time - m_lastTimeSizeWasStored) > 0.25f)
                {
                    m_lastTimeSizeWasStored = Time.time;
                    StoreSize(sliderValue);
                }
            });
        }
Example #5
0
    public void NetControlOnSlider(long userId, string msgKey, List <float> msgs)
    {
        Debug.Log($"[slider] Got {msgKey}");

        switch (msgKey)
        {
        case "CollectiveSlider":
            collectiveSlider.SetSliderValue(msgs[0]);
            break;

        case "SpeedSlider":
            speedSlider.SetSliderValue(msgs[0]);
            break;

        case "SizeSlider":
            sizeSlider.SetSliderValue(msgs[0]);
            break;

        case "RadialSlider":
            var pos = new Vector2(msgs[2], msgs[3]);
            radialSlider.SetAngRad(msgs[0], msgs[1], pos);
            break;
        }
    }