private CatagoryElement ConstructCatagoryElement(CatagoryModel model, decimal total, int index) { CatagoryElement newExpense = GameObject.Instantiate(original: CatagoryElements[index - 1], parent: CatagoryElements[index - 1].transform.parent.transform) as CatagoryElement; RectTransform newRect = newExpense.GetComponent <RectTransform>(); newRect.anchoredPosition = new Vector3(newRect.anchoredPosition.x, newRect.anchoredPosition.y - CatagoryOffset); //newExpense.SetTileRect(TileRect); Add Later if I want the catagory tiles to scroll. newExpense.UpdateView(model, total); return(newExpense); }
public void Awake(CatagoryElement original, RectTransform tileRect, TextMeshProUGUI headerText, TextMeshProUGUI spentText, bool recurring) { CatagoryElements[0] = original; IsRecurring = recurring; TileRect = tileRect; StartingTileHeight = TileRect.sizeDelta.y; Header = headerText; Spent = spentText; }
private void ResetOriginalElement(CatagoryElement original, int arrayLength) { CatagoryElements = new CatagoryElement[arrayLength]; CatagoryElements[0] = original; }