Skip to content
Permalink
Browse files
Created Value controller
The value controller is responsible for updating the value of a UI Text object.
  • Loading branch information
wlodarsb committed May 3, 2020
1 parent c16d6c4 commit b950b275294432debb6a10a106d72ee56a28cf33
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ValueController : MonoBehaviour
{
public Slider slider;

private void Start()
{
SetValue();
}

public void SetValue()
{
gameObject.GetComponent<Text>().text = Mathf.Round(slider.value).ToString();
}
}

Some generated files are not rendered by default. Learn more.

0 comments on commit b950b27

Please sign in to comment.