public override void StartAction() { var move = new CMove(); CCell cell = selected.cell.Clone(); field.SetIconAt(targeted.cell, selected); field.SetIconAt(cell, targeted); move.AddMove(selected, field.GetIconCenterByCell(selected.cell)); move.AddMove(targeted, field.GetIconCenterByCell(targeted.cell)); move.SetObserver(this); }
private void DeadFreeFall(int col, List <CIcon> dead) { int number = 0; int height = field.height; foreach (CIcon icon in dead) { field.SetIconAt(new CCell(height - dead.Count + number, col), icon); icon.SetState(EState.Idle); icon.gameObject.transform.position = field.GetIconCenterByCell( new CCell(height + number, col) ); icon.SetRandomColor(); move.AddMove(icon, field.GetIconCenterByCell(icon.cell)); number++; } }