IEnumerator RotateBlock(float angle) { int rotDir = (int)Mathf.Sign(angle); while (Mathf.Abs(angle) > maxRotationDelta) { transform.Rotate(0f, maxRotationDelta * rotDir, 0f); angle -= maxRotationDelta * rotDir; yield return(new WaitForSeconds(0.01f)); } transform.Rotate(0f, angle, 0f); ConfigAll.ConfigQuads(); ConfigCurrents(); }
public void ChangeBetType(ConfigAll config) { Acc.Choose = config.Choose; Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).Choose = config.Choose; if (Acc.Choose == 0) { Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).OverOdd = double.Parse(txtOdd.Text.Trim()); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).OverDigit = cbDigit.SelectedIndex; } else { Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).UnderOdd = double.Parse(txtOdd.Text.Trim()); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).UnderDigit = cbDigit.SelectedIndex; } ReFreshAccountView(Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key)); }
public void SaveConfig(ConfigAll config) { txtStake.Text = config.Stake.ToString(); txtRate.Text = config.Rate.ToString(); txtOdd.Text = config.OddRate.ToString(); lblStakeVnd.Text = ConvertUtils.ToMoneyText(config.StakeVnd); cbDigit.SelectedIndex = config.Digit; Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).Stake = int.Parse(txtStake.Text.Trim()); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).Rate = int.Parse(txtRate.Text.Trim()); if (Acc.Choose == 1) { Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).UnderOdd = double.Parse(txtOdd.Text.Trim()); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).UnderDigit = cbDigit.SelectedIndex; } else { Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).OverOdd = double.Parse(txtOdd.Text.Trim()); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).OverDigit = cbDigit.SelectedIndex; } }
private void btnApplyStakeBuy_Click(object sender, EventArgs e) { if (txtStakeBuy.Text.Trim() == "") { MessageBox.Show("Please insert stake!"); return; } foreach (var item in flpBuy.Controls) { try { var x = (UCConfig)item; var config = new ConfigAll() { Stake = ConvertUtils.ToDouble(txtStakeBuy.Text.Trim()) }; x.SaveConfigStakeOnly(config); } catch (Exception) { } } Program.SaveBetConfig(); }
public void SaveConfigStakeOnly(ConfigAll config) { txtStake.Text = config.Stake.ToString(); lblStakeVnd.Text = ConvertUtils.ToMoneyText(config.StakeVnd); Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key).Stake = int.Parse(txtStake.Text.Trim()); }
//刷新DLC public void RefreshDLC() { Config.Clear(); AllDirectory.Clear(); CopyDirectory.Clear(); IgnoreConstSet.Clear(); ConfigExtend.Clear(); ConfigAll.Clear(); EditorExtend.Clear(); EditorAll.Clear(); foreach (var item in BuildRule) { AddBuildConfig(item); } foreach (var item in IgnoreConst) { AddIgnoreConst(item); } //加载内部dlc ConfigInternal = new DLCItemConfig(Const.STR_InternalDLC); EditorInternal = new DLCItem(ConfigInternal); //加载原生dlc ConfigNative = new DLCItemConfig(Const.STR_NativeDLC); EditorNative = new DLCItem(ConfigNative); //加载其他额外DLC foreach (var item in DLC) { var dlcItem = new DLCItemConfig(item.Name); ConfigExtend.Add(dlcItem); EditorExtend.Add(new DLCItem(dlcItem)); } ConfigAll = new List <DLCItemConfig>(ConfigExtend); ConfigAll.Add(ConfigInternal); ConfigAll.Add(ConfigNative); EditorAll = new List <DLCItem>(EditorExtend); EditorAll.Add(EditorInternal); EditorAll.Add(EditorNative); #if UNITY_EDITOR if (!Application.isPlaying) { foreach (var item in AllDirectory) { FileUtil.EnsureDirectory(Path.Combine(Const.Path_NativeDLC, item)); } foreach (var item in DLC) { foreach (var dic in AllDirectory) { FileUtil.EnsureDirectory(Path.Combine(Const.Path_Bundles, item.Name, dic)); } } } #endif }
IEnumerator MoveBlock(Vector3 target) { PlayerController.PlayerMovedUnit += CheckTeleport; teleportFlag = false; bool gotIt = false; if (objectAbove == null) { transform.Find("DetectObject").GetComponent <DetectObjects>().CheckFirst(); if (target.y - transform.position.y > 0) { gotIt = transform.Find("DetectObject").GetComponent <DetectObjects>().CheckObject(gotIt); } } gotIt = transform.Find("DetectObject").GetComponent <DetectObjects>().CheckObject(gotIt); Vector3 targetAbove = target; if (largeAnim) { mainCamera.transform.Rotate(25, 0, 0, Space.Self); mainCamera.transform.position = new Vector3(mainCamera.transform.position.x, mainCamera.transform.position.y + 2, mainCamera.transform.position.z); InputManager.lock3D = true; InputManager.canMove = false; } while (transform.position != target) { if (objectAbove == null && !teleportFlag && target.y - transform.position.y > 0) { gotIt = transform.Find("DetectObject").GetComponent <DetectObjects>().CheckObject(gotIt); } if (teleportFlag) { objectAbove = null; } transform.position = Vector3.MoveTowards(transform.position, target, maxDistanceDelta); if (objectAbove != null) { targetAbove = transform.position; targetAbove.y += 1; objectAbove.transform.position = targetAbove; PlayerController.prev_pos = -1; GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>().MovePlayer(InputManager.GetAngle()); } //PlayerController.CheckPlayerDeath(); yield return(new WaitForSeconds(0.01f)); } if (objectAbove != null) { targetAbove = transform.position; targetAbove.y += 1; objectAbove.transform.position = targetAbove; PlayerController.prev_pos = -1; GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>().MovePlayer(InputManager.GetAngle()); objectAbove = null; } if (largeAnim) { mainCamera.transform.Rotate(-25, 0, 0, Space.Self); mainCamera.transform.position = new Vector3(mainCamera.transform.position.x, mainCamera.transform.position.y - 2, mainCamera.transform.position.z); InputManager.lock3D = false; InputManager.canMove = true; } ConfigAll.ConfigQuads(); ConfigCurrents(); PlayerController.PlayerMovedUnit -= CheckTeleport; }