/// <summary> /// Adds a BounceObjectUI to the display based on the passed in BouncingObjectSettings. /// </summary> /// <param name="bouncingObject">The object to add to the UI display.</param> public void AddTrialObject(BasicTrialManager.BouncingObjectSettings bouncingObject) { if (BounceObjectList == null) { BounceObjectList = new List <BounceObjectUI> (); } BounceObjectUI bounceUI = GameObject.Instantiate <BounceObjectUI> (BouncingObjectUIPrefab); bounceUI.InitializeUI(this, bouncingObject); bounceUI.GetComponent <RectTransform> ().SetParent(ObjectDisplayLayout.transform, false); BounceObjectList.Add(bounceUI); }
/// <summary> /// Removes the passed in BounceObjectUI from the display and the test setup. /// </summary> /// <param name="trialObject">The object to remove.</param> public void RemoveTrialObject(BounceObjectUI trialObject) { foreach (BounceObjectUI ui in BounceObjectList) { if (ui.Equals(trialObject)) { Destroy(ui.gameObject); BounceObjectList.Remove(ui); break; } } }