//绘制BOX 弹出框 int DrawBoxWithPop(string title, int direction, ref string[] showstring) { DrowBox(title); GUILayout.BeginVertical(); GUILayout.Space(5); enDirection getdirection = (enDirection)EditorGUILayout.Popup(direction, showstring, GUILayout.Width(100)); GUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); return((int)getdirection); }
internal RapidScalpingInfo(RdzRobot robot, Candlestick TriggerBar, enDirection Direction, int TolerancePoints = 3, int RiskMultiplier = 1) { this.TriggerBar = TriggerBar; this.Direction = Direction; this.IsDefined = false; this.TolerancePoints = TolerancePoints; this.robot = robot; this.RiskMultiplier = RiskMultiplier; Last5Candlesticks = new List <Candlestick>(); for (int i = 0; i < 5; i++) { Last5Candlesticks.Add(this.robot.GetMarketSeries(i + 1)); } }
//根据方向获取角度 int GetAngelWithDireciton(enDirection direction) { int angel = 0; switch (direction) { case enDirection.enInviled: angel = 0; break; case enDirection.enBottom: angel = 1; break; case enDirection.enBottomRight: angel = 2; break; case enDirection.enRight: angel = 3; break; case enDirection.enTopRight: angel = 4; break; case enDirection.enTop: angel = 5; break; case enDirection.enTopLeft: angel = 6; break; case enDirection.enLeft: angel = 7; break; case enDirection.enBottomLeft: angel = 8; break; default: Debug.Log("错误"); break; } return(angel); }
public static void SerialPort(SerialPort serial, string str, enDirection direct = enDirection.Send) { string serialConfig = ""; string appendString = ""; try { serialConfig = serial.PortName + "," + serial.BaudRate.ToString() + "," + serial.DataBits.ToString() + "," + serial.Parity.ToString() + "," + serial.StopBits.ToString(); if (direct == enDirection.Send) { appendString = "[" + serialConfig + " " + "S] " + str; } else if (direct == enDirection.Receive) { appendString = "[" + serialConfig + " " + "R] " + str; } //appendString = clsUtils.Ascii2Reveal(appendString); WriteLine(appendString); } catch { } }
//设置信息 public void SetInfo(GameObject obj) { mo_ChooseObj = null; if (obj == null) { return; } mcs_Borninfo = obj.GetComponent <BornInfo>(); if (mcs_Borninfo == null) { return; } mo_ChooseObj = obj; me_Direction = GetDirectionWithAngel(mcs_Borninfo.GetDiretionAngel()); mi_ChooseId = obj.GetInstanceID(); if (me_Direction == enDirection.enInviled) { me_Direction = enDirection.enTop; mo_ChooseObj.transform.rotation = Quaternion.Euler(new Vector3(mo_ChooseObj.transform.rotation.x, 0, mo_ChooseObj.transform.rotation.z)); } }