void Update() { if (IsPlaying || isPlaying) { if (IsDown) { mp = MP; } if (IsClick) { dis = V3.Dis(MP, mp); if (dis > radius) { mp = V3.Move(MP, mp, radius); } horseTf.rotation = Q.Euler(0, Ang.LookForward(mp, MP), 0); } if (IsUp) { rb.V0(); } } else { rb.V0(); } }
void Update() { if (IsPlaying) { if (IsDown) { MouseButtonDown(); } if (IsClick) { Controller(); } if (IsUp) { animator.SetBool("Run", false); isLasso = true; } if (isLasso) { lasso.transform.position += transform.forward * Time.deltaTime * 20f; Vector3 vPort = A.Cam.WorldToScreenPoint(lasso.transform.position); if (vPort.y < 0 || vPort.y > A.Cam.pixelHeight || vPort.x < 0 || vPort.x > A.Cam.pixelWidth) { isLassoOutScreen = true; } if (isLassoOutScreen) { if (V3.Dis(lasso.transform.position, lassoStartTf.position) > 0.5f) { lasso.transform.position = V3.Move(lasso.transform.position, lassoStartTf.position, 0.5f); } else { isLasso = false; isLassoOutScreen = false; } } } } }
/// <summary> /// 将三角形的三个点进行平移 /// </summary> /// <param name="translation"></param> /// <param name="distance"></param> /// <returns></returns> public Triangle Translate(Vector3d translation, double distance) { return(new Triangle(V1.Move(translation, distance), V2.Move(translation, distance), V3.Move(translation, distance))); }
/// <summary> /// 将三角形的三个点依次平移 /// </summary> /// <param name="translation"></param> /// <returns></returns> public Triangle Translate(Vector3d translation) { return(new Triangle(V1.Move(translation), V2.Move(translation), V3.Move(translation))); }