/// <summary> /// Places a <see cref="UICodeblock"/> under another one. /// </summary> private void PlaceUnderCodeblock(UICodeblock item, UICodeblock parent) { float yPos = -parent.GetComponent <RectTransform>().sizeDelta.y; item.transform.SetParent(parent.transform); item.PositionController.TargetLocalPosition = new Vector3(0, yPos); }
public void RemoveFromContent(UICodeblock item) { item.transform.SetParent(_handle); item.PositionController.TargetLocalPosition = item.PositionController.LocalPosition; RectTransform rt = item.GetComponent <RectTransform>(); foreach (InputContent content in FindObjectsOfType <InputContent>()) { content.UpdateEvaluateableProperty(); } }
public void InsertIntoInputContent(UICodeblock item, InputContent content) { item.transform.SetParent(content.DropArea); item.PositionController.TargetLocalPosition = new Vector3(0, 0); RectTransform rt = item.GetComponent <RectTransform>(); rt.anchorMin = Vector2.zero; rt.anchorMax = Vector2.one; rt.sizeDelta = Vector2.zero; content.UpdateEvaluateableProperty(); }