Example #1
0
 /// <summary>
 /// updates the UI with the new parameters
 /// </summary>
 /// <param name="param"></param>
 public void TryDesigning(List <float> param)
 {
     try
     {
         List <Transform> lines = GameObjectHelper.GetAllChilds(Values);
         for (int i = 1; i < lines.Count; i++) // not 0 because we don't modify the ID
         {
             lines[i].GetComponentInChildren <TMP_Text>().text = param[i].ToString();
         }
     } catch (Exception) { }
 }
Example #2
0
        /// <summary>
        /// get the parameters inside the UI
        /// </summary>
        /// <returns>a list of parameters as List<float> </returns>
        private List <float> GetCurrentParameters()
        {
            List <float>     param = new List <float>();
            List <Transform> lines = GameObjectHelper.GetAllChilds(GameObjectHelper.FindGameObjectInChildWithTag(selectablesUI[0], "Values").GetComponent <Canvas>());

            foreach (Transform line in lines)
            {
                string value = line.GetComponentInChildren <TMP_Text>().text;

                int.TryParse(value, out int j);

                param.Add(j);
            }
            return(param);
        }