private GameObject instantiateCommandBox(Command command, int index, int nestLevel) { GameObject box = Instantiate(command.getCommandBoxPreFab()) as GameObject; box.transform.SetParent(gameObject.transform); /// Place and fix local scale box.transform.localPosition = calculateBoxPosition(box, index, nestLevel); box.transform.localScale = new Vector2(1, 1); box.GetComponent<CommandBox>().Init(command); return box; }