public void AddIncome(int[] ids, double[] valuesOnEachPurse, string title, double value, char curency) { incomes.Add(ids, valuesOnEachPurse, title, value, curency); amountControl.Add("Income", curency, value, true); int index = incomes.Titles.Count - 1; incomeControl.Render(ids, valuesOnEachPurse, title, value, curency, DateTime.Parse(incomes.CreateDates[index]), index); StartCoroutine(incomeControl.UpdateContentHeight()); }
public void Delete() { var index = int.Parse(name); bool isToday; GameObject[] items = GameObject.FindGameObjectsWithTag(tag); RectTransform rect; Vector2 posVector; for (var i = index + 1; i < items.Length - 1; i++) { items[i].name = (i - 1).ToString(); rect = items[i].GetComponent <RectTransform>(); posVector = rect.anchoredPosition; posVector.y += 150; rect.anchoredPosition = posVector; } if (tag == "Income") { isToday = mainControl.incomes.IsToday[index]; mainControl.incomes.RemoveAt(index); } else { isToday = mainControl.costs.IsToday[index]; mainControl.costs.RemoveAt(index); } amountController.Add(tag, Curency, -Value, isToday); Destroy(gameObject); }