public void CreateMarker(ShotInfo info) { ShotInfoMarker marker = Instantiate(markerBase).GetComponent <ShotInfoMarker>(); marker.transform.SetParent(this.transform); marker.Set(info); marker.ColorCheck(false); markerList.Add(marker); }
public override void Progress(Sync[] s) { if (Input.GetMouseButtonDown(0)) { mousePos = GetMousePosition(); if (CollisionCheck(mousePos) != -1) { if (select == null) { isMove = true; AngleSetUp(); clickPos = mousePos; select = this; ColorCheck(true); s[0](); } else if (select == this) { AngleSetUp(); clickPos = mousePos; } else { select.ColorCheck(false); select.isMove = false; AngleSetUp(); isMove = true; clickPos = mousePos; select = this; ColorCheck(true); s[0](); } } } if (Input.GetMouseButton(0) && select == this) { mousePos = GetMousePosition(); if (!isMove) { if (CollisionCheck(mousePos) != -1) { if (clickPos - mousePos != Vector2.zero) { isMove = true; } } } if (isMove) { GetCurrAngle(); float angle = originAngle - (clickAngle - currAngle); if (Input.GetKey(KeyCode.LeftShift)) { int factor = 10; if (Input.GetKey(KeyCode.LeftControl)) { factor = 30; } angle = (float)((int)angle / factor) * (float)factor; } transform.rotation = Quaternion.Euler(0f, 0f, angle); info.angle = angle; s[2](); } } if (Input.GetMouseButtonUp(0) && select == this) { if (isMove) { isMove = false; } else { if (CollisionCheck(mousePos) != -1) { ColorCheck(false); select = null; s[1](); } } } }