Task changeTask(int i, char ch, int count) { TaskList tl = new TaskList(); Task remove = new TweenTask(delegate { chars_[i].gameObject.transform.eulerAngles = new Vector3(0, 0, 0); return(TweenRotation.Begin(chars_[i].gameObject, 0.15f, Quaternion.Euler(new Vector3(270, 0, 0)))); }); TaskManager.PushBack(remove, delegate { chars_[i].gameObject.SetActive(false); }); tl.push(remove); Task add = new TweenTask(delegate { VoxelChar vc = _create.create(ch); if (vc != null) { vc.gameObject.SetActive(true); vc.setLayer(this.gameObject.layer); vc.setMainColor(_maincolor); vc.setLightColor(_lightColor); vc.gameObject.transform.SetParent(this.transform); vc.gameObject.transform.localScale = Vector3.one; vc.gameObject.transform.localPosition = this.getOffset(count, i); chars_[i] = vc; vc.gameObject.transform.eulerAngles = new Vector3(-270, 0, 0); return(TweenRotation.Begin(vc.gameObject, 0.15f, Quaternion.Euler(new Vector3(0, 0, 0)))); } return(null); }); tl.push(add); return(tl); }