public void RemoveCardButton(CCSCardButton button) { int index = FindButtonIndexByName(button.Name.text); FindObjectOfType <CCSCardAreaPanel>().CardRemoved(button.Name.text); Destroy(button.gameObject); BumpDown(index); DecreaseHandSize(); HandPosIndex--; }
void BumpDown(int index) { CCSCardButton button = Positions[index + 1].GetComponentInChildren <CCSCardButton>(); if (button != null) { button.transform.SetParent(Positions[index].transform); button.transform.localPosition = new Vector3(10, 0, 0); BumpDown(index + 1); } }