public static void UpdateSlider(Slider newSliderData) { if (instance != null) { instance.tree.SetSliderAtDir(newSliderData); M3DHandler.UpdateSlider(newSliderData.sliderID, Convert.ToSingle(newSliderData.sliderValue)); } }
public static bool UpdateSliderCheck(Slider newSliderData) { if (instance != null) { if (M3DHandler.UpdateSliderCheck(newSliderData.sliderID, Convert.ToSingle(newSliderData.sliderValue))) { instance.tree.SetSliderAtDir(newSliderData); return(true); } } return(false); }
IEnumerator UpdateMorphs() { //slowly update all character morphs. List <Slider> sliderList = tree.GetCompleteSliderList(); Debug.Log("Loading Morphs from File. Slider Count: " + sliderList.Count.ToString()); PublicLoadingBar.AddNewStuff(sliderList.Count, 10); if (!busy) { busy = true; int count = 0; for (int i = 0; i < sliderList.Count; i++) { Type sliderType = sliderList[i].sliderValue.GetType(); if (sliderType == typeof(float) || sliderType == typeof(int)) { if (M3DHandler.UpdateSliderCheck(sliderList[i].sliderID, Convert.ToSingle(sliderList[i].sliderValue))) { count++; } } if (count > batchSize) { count = 0;// reset the count for the next iteration. yield return(null); } PublicLoadingBar.UpdateProgress(1); //can also check for things like "colours" and stuff like that, once we get more complicated. } Debug.Log("Successfully loaded morphs from file."); //m3DHandler.RecalculateBounds(); busy = false; } }
private void Awake() { instance = this; manager = gameObject.GetComponent <MORPH3D.M3DCharacterManager>(); }