public void getMarkStopPos() { float maxPos = 0; int maxNum = 0; for (int i = 0; i < reel1.Length; i++) { if (maxPos < markDic[i].transform.position.y) { maxPos = markDic[i].transform.position.y; maxNum = i; } } if (markDic[maxNum].transform.position.y != markDic[maxNum].GetComponent <MarkControl>().startPos.y) { maxNum -= 1; if (maxNum < 0) { maxNum = reel1.Length - 1; } topNum = maxNum; } for (int i = 0; i < reel1.Length; i++) { int stopNum = 0; MarkControl markControl = markDic[i].GetComponent <MarkControl>(); if ((i - maxNum) >= 0) { stopNum = i - maxNum; } else { stopNum = reel1.Length + (i - maxNum); } switch (stopNum) { case 6: upperMark = markControl.gameObject; break; case 7: middleMark = markControl.gameObject; break; case 8: bottomMark = markControl.gameObject; break; } markDic[i].transform.position = markControl.startPos - new Vector3(0, stopNum * markHeight, 0); markControl.spinOff = true; markControl.spinOn = false; } }
private void ReelCreator(string[] reel) { for (int i = 0; i < reel.Length; i++) { GameObject markIns = Instantiate(mark); markDic.Add(i, markIns); markIns.name = reel[i]; markIns.transform.parent = gameObject.transform; MarkControl markContorol = markIns.GetComponent <MarkControl>(); markContorol.markNum = i; markContorol.startPos = new Vector3(gameObject.transform.position.x, Mathf.Ceil(reel.Length / 2) * markHeight, 0); markContorol.endPos = markContorol.startPos - new Vector3(0, markHeight * (reel.Length), 0); markIns.transform.position = markContorol.startPos - new Vector3(0, markHeight * i, 0); markIns.GetComponent <MarkControl>().markName = reel[i]; switch (reel[i]) { case "bar": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_bar", typeof(Sprite)) as Sprite; break; case "bud": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_budo", typeof(Sprite)) as Sprite; break; case "che": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_chelly", typeof(Sprite)) as Sprite; break; case "pie": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_piero", typeof(Sprite)) as Sprite; break; case "sai": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_sai_2", typeof(Sprite)) as Sprite; break; case "sev": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_seven", typeof(Sprite)) as Sprite; break; case "bel": markIns.GetComponent <SpriteRenderer>().sprite = Resources.Load("Image/mark_bell", typeof(Sprite)) as Sprite; break; } } }
public EIBNodeConnectorBase() { /*this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);*/ this.linecmenu = new System.Windows.Forms.ContextMenu(); this.centerMark = new MarkControl(); this.centerMark.parentConnector = this; }