async public void refreshScreen() { currentPole = await App._database.dbFetchTasksByIdTablePoleInfoAsync(id); textPoleID.Text = "Pole ID: " + currentPole.poleID; currentPole.dateTaskPerformed = DateTime.Now.ToString("MM-dd-yyyy"); }
// Update is called once per frame void Update() { if (shouldMove) { for (int i = 0; i < poleInfoList.Count; i++) { PoleInfo currentPole = poleInfoList[i]; float positionDifference = currentPole.transform.localPosition.y - currentPole.startPosition.y; if (currentPole.movingUp && positionDifference > 5f) { currentPole.movingUp = false; } else if (!currentPole.movingUp && positionDifference < -5f) { currentPole.movingUp = true; } if (currentPole.movingUp) { currentPole.transform.Translate(Vector3.up * Time.deltaTime * .5f); } else { currentPole.transform.Translate(Vector3.up * Time.deltaTime * -.5f); } } } }
async public Task <bool> dbUpdateTablePoleInfoAsync(PoleInfo pInfo) { await dbAsyncConnection.UpdateAsync(pInfo); return(true); }
async public Task <PoleInfo> dbFetchTasksByIdTablePoleInfoAsync(string id) { int poleid = Convert.ToInt32(id, 10); PoleInfo l = await(from s in dbAsyncConnection.Table <PoleInfo>() where s.id == poleid select s).FirstOrDefaultAsync(); return(l); }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (version == true) { _program.SelectedIndex = 0; } else { edit_item = new Class.Edit_Item(this); PoleInfo?.Invoke(this, EventArgs.Empty); Load_View_Edit_Form(); } }
// Use this for initialization void Start() { //Gather all poles and put them in the list for (int i = 0; i < transform.childCount; i++) { PoleInfo info = new PoleInfo(); info.transform = transform.GetChild(i); info.startPosition = transform.GetChild(i).localPosition; info.movingUp = true; poleInfoList.Add(info); } }
void Swap(PoleInfo _from, PoleInfo _to) { int fromSize = _from.GetSize(); --fromSize; int toSize = _to.GetSize(); //------ // ToDo //------ // _from のデータから、動かす Disk の確定 // 何処に動かすか? //moveInfo.fromStr = _from.name; //moveInfo.toStr = _to.name; moveInfo.fromElementNum = fromSize; moveInfo.toElementNum = toSize; moveInfo.afterX = GetMoveAfterX(_to.name); moveInfo.afterY = y[moveInfo.toElementNum]; moveInfo.diskNumber = GetDiskNum(_from.name); Vector3 vec = disk[moveInfo.diskNumber].gameObject.transform.localPosition; moveInfo.beforeX = vec.x; moveInfo.beforeY = vec.y; //------ int temp = _from.ary[fromSize]; _from.ary[fromSize] = _to.ary[toSize]; _to.ary[toSize] = temp; }
IEnumerator MoveCalc(PoleInfo _from, PoleInfo _to, PoleInfo _work, int _n) { if (_n < 1) { //return; yield return(new WaitForSeconds(0)); } else if (_n == 1) { Swap(_from, _to); Print(); yield return(StartCoroutine(WaitToFinishAnimation())); // アニメーション完了するまで待機 } else { yield return(StartCoroutine(MoveCalc(_from, _work, _to, _n - 1))); Swap(_from, _to); Print(); yield return(StartCoroutine(WaitToFinishAnimation())); // アニメーション完了するまで待機 yield return(StartCoroutine(MoveCalc(_work, _to, _from, _n - 1))); } }