Dynamic List update
Hello Everyone since this is my first question Please ask if i am not explaining properly.
I have a Machine that contain multiple Parts right now i have 9 parts and on checkbox selection and at the sametime i want to implement whole cart system also. what i want is that when the user will select one part through Checkbox toggle on selection then list will be updated and product will be visible in the cart system. In the below script On checkbox selection my Text is hiding i can make it visible but List update i dont know how to do it. Thanks in Advance
using UnityEngine; using System.Collections; using UnityEngine.UI;
public class ViewModel : MonoBehaviour { public Text buttonText; public GameObject cube; public Slider slider;
public void Slider_Changed(float newValue)
{
Vector3 pos = cube.transform.position;
pos.y = newValue;
cube.transform.position = pos;
}
public void Button_Click()
{
Debug.Log("Hello, World!");
}
public void Button_String(string msg)
{
buttonText.text = msg;
}
public void Toggle_Changed(bool newValue)
{
cube.SetActive(newValue);
slider.interactable = newValue;
}
public void Text_Changed(string newText)
{
float temp = float.Parse(newText);
cube.transform.localScale = new Vector3(temp, temp, temp);
}
}
Your answer
Follow this Question
Related Questions
[SOLVED]Removing gameobject from list don't change the index 1 Answer
item not adding to list correctly! 1 Answer
How do i set two(or multiple) [] as one?? 1 Answer
"error CS1501: No overload for method `Add' takes `2' arguments" 0 Answers
Why is my List adding to same array object again and again in update? 1 Answer