Пример #1
0
 protected virtual void Start()
 {
     if (slider == null)
     {
         slider = GetComponentInParent <InteractionSlider>();
     }
 }
    protected override void Reset()
    {
        base.Reset();

        slider       = GetComponent <InteractionSlider>();
        outputFormat = "F2";
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        // material = objectReference.GetComponent<Renderer>().sharedMaterial;
        InteractionSlider slider = sliderObject.GetComponent <InteractionSlider>();

        //textObject.GetComponent<UnityEngine.UI.Text>().text = StringOnValue(slider.HorizontalSliderValue);
        if (homePressed)
        {
            float   step            = speed * Time.deltaTime;
            Vector3 targetDirection = target.position - homeLocation.transform.position;
            homeLocation.transform.position = Vector3.MoveTowards(homeLocation.transform.position, target.position, step);
            if (Vector3.Distance(homeLocation.transform.position, target.position) < 0.1f)
            {
                homePressed = false;
                foreach (GameObject objectToShow in objectsToShow)
                {
                    objectToShow.SetActive(true);
                }
            }
        }

        foreach (GameObject objectToColor in objectsToColor)
        {
            currentColor = ColorOnValue(slider.HorizontalSliderValue);
            objectToColor.GetComponent <Image>().color = currentColor;
        }
        // material.SetFloat("_Density", (1/slider.HorizontalSliderValue) /2);
    }
Пример #4
0
    void Start()
    {
        _intObj = GetComponent <InteractionBehaviour>();
        _sliObj = GetComponent <InteractionSlider>();

        _renderer = GetComponentInChildren <SpriteRenderer>();
    }
Пример #5
0
    void Reset()
    {
        if (slider == null)
        {
            slider = GetComponent <InteractionSlider>();
        }
        if (sliderGraphic == null)
        {
            sliderGraphic = slider.GetComponent <LeapGraphic>();
            if (sliderGraphic == null)
            {
                sliderGraphic = slider.GetComponentInChildren <LeapGraphic>();
            }
        }
        if (panelGraphic == null && slider.transform.parent != null)
        {
            panelGraphic = slider.transform.parent.GetComponentInParent <LeapGraphic>();
        }

        panelGraphicColor   = new Color(0.86F, 0.86F, 0.86F);
        panelDepressedColor = new Color(0.86F, 0.86F, 0.86F);
        panelDisabledColor  = new Color(0.60F, 0.60F, 0.60F);
        panelTint           = Color.white;

        sliderGraphicColor   = new Color(1.00F, 1.00F, 1.00F);
        sliderDepressedColor = new Color(0.60F, 0.60F, 0.60F);
        sliderDisabledColor  = new Color(0.80F, 0.80F, 0.80F);
        sliderTint           = Color.white;
    }
Пример #6
0
    void Update()
    {
        HorizontalSlider = SliderObject.GetComponent <InteractionSlider>();
        SliderValue      = HorizontalSlider.HorizontalSliderPercent;
        SliderValue      = SliderValue * 100;

        //arduino.analogWrite(PWMPin, VoltageInt);
    }
Пример #7
0
    void Update()
    {
        HorizontalSlider = SliderObject.GetComponent <InteractionSlider>();
        SliderValue      = HorizontalSlider.HorizontalSliderPercent;
        SliderValue      = SliderValue * SliderMultiplier;

        LightOne.intensity = SliderValue;
        LightTwo.intensity = SliderValue;
    }
Пример #8
0
    public void ValueChanged(InteractionSlider slider)
    {
        Color newColor = new Color();

        newColor[colorIndex]    = slider.HorizontalSliderValue;
        backPanelMaterial.color = newColor;

        ColorManager.Instance.UpdateColor(colorIndex, slider.HorizontalSliderValue);
    }
Пример #9
0
        protected override void Reset()
        {
            base.Reset();

            if (slider == null)
            {
                slider = GetComponentInParent <InteractionSlider>();
            }
        }
Пример #10
0
 void Update()
 {
     HorizontalSlider = SliderObject.GetComponent <InteractionSlider>();
     _slidervalue     = HorizontalSlider.HorizontalSliderPercent;
     _slidervalue     = _slidervalue * SliderMultiplier;
     if (_slidervalue > 90)
     {
         _onSummon.Invoke();
     }
     if (_slidervalue < 10)
     {
         _onUnsummon.Invoke();
     }
 }
Пример #11
0
    protected override void initialize()
    {
        base.initialize();

        if (button != null && button is InteractionSlider)
        {
            slider = button as InteractionSlider;
        }

        if (slider != null)
        {
            button = slider;
        }
    }
    public void setToggleActive(InteractionSlider slider)
    {
        bool activateButton = slider.HorizontalSliderPercent < 0.5f;

        //Order is important here, don't try to be clever
        if (activateButton)
        {
            toggle.enabled = false;
            button.enabled = true;
        }
        else
        {
            button.enabled = false;
            toggle.enabled = true;
        }
    }
    // Use this for initialization
    void Start()
    {
        intMetal = sliderMetal.GetComponent <InteractionSlider>();
        intWood  = sliderWood.GetComponent <InteractionSlider>();
        intBrick = sliderBrick.GetComponent <InteractionSlider>();
        intWater = sliderWater.GetComponent <InteractionSlider>();
        intSkin  = sliderSkin.GetComponent <InteractionSlider>();

        intButtonNext = nextButton.GetComponent <InteractionButton>();

        // Initial setup for which blocks should be shown
        metalBlock.SetActive(true);
        woodBlock.SetActive(false);
        brickBlock.SetActive(false);
        waterBlock.SetActive(false);
        skinBlock.SetActive(false);
    }
Пример #14
0
 void Update()
 {
     HorizontalSlider = SliderObject.GetComponent <InteractionSlider>();
     _slidervalue     = HorizontalSlider.HorizontalSliderPercent;
     _slidervalue     = _slidervalue * SliderMultiplier;
     if (_slidervalue < 33)
     {
         _left.Invoke();
     }
     if (_slidervalue > 33 && _slidervalue < 65)
     {
         _center.Invoke();
     }
     if (_slidervalue > 66)
     {
         _right.Invoke();
     }
 }
    private void Awake()
    {
        slider1 = GetComponent <InteractionSlider>();

        if (slider1 != null)
        {
            stepsH1 = slider1.horizontalSteps;
            stepsV1 = slider1.verticalSteps;
            slider1.OnPress.AddListener(new UnityEngine.Events.UnityAction(OnPress));
            slider1.OnUnpress.AddListener(new UnityEngine.Events.UnityAction(OnUnpress));
        }

        slider2 = GetComponent <InteractionCircularSlider>();

        if (slider2 != null)
        {
            steps2 = slider2.steps;
            slider2.OnPress.AddListener(new UnityEngine.Events.UnityAction(OnPress));
            slider2.OnUnpress.AddListener(new UnityEngine.Events.UnityAction(OnUnpress));
        }
    }
Пример #16
0
    void Reset()
    {
        if (simManager == null)
        {
            simManager = FindObjectOfType <SimulationManager>();
        }

        if (fieldForceSlider == null)
        {
            fieldForceSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetBoundingForce>().GetComponent <InteractionSlider>();
        }
        if (fieldRadiusSlider == null)
        {
            fieldRadiusSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetBoundingRadius>().GetComponent <InteractionSlider>();
        }
        if (socialForceSlider == null)
        {
            socialForceSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetMaxForce>().GetComponent <InteractionSlider>();
        }
        if (socialRadiusSlider == null)
        {
            socialRadiusSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetMaxRange>().GetComponent <InteractionSlider>();
        }
        if (dragSlider == null)
        {
            dragSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetDrag>().GetComponent <InteractionSlider>();
        }
        if (particleCountSlider == null)
        {
            particleCountSlider = Utils.FindObjectInHierarchy <SimulatorSliderSetParticleCount>().GetComponent <InteractionSlider>();
        }

        if (zoomController == null)
        {
            zoomController = Utils.FindObjectInHierarchy <SimulationZoomController>();
        }
    }
Пример #17
0
 void Update()
 {
     HorizontalSlider = SliderObject.GetComponent <InteractionSlider>();
     SliderValue      = HorizontalSlider.HorizontalSliderPercent;
     SliderValue      = SliderValue * SliderMultiplier;
 }
 void Reset()
 {
     dependentSlider = this.GetComponent <InteractionSlider>();
 }
 void Reset()
 {
     slider = GetComponent <InteractionSlider>();
 }
Пример #20
0
 private void Awake()
 {
     instance = this;
 }