void DrawRope() { if (!straightLine) { if (m_lineRenderer.GetPosition(percision - 1).x != grapplingGun.grapplePoint.x) { DrawRopeWaves(); } else { straightLine = true; } } else { if (!isGrappling) { grapplingGun.Grapple(); isGrappling = true; } if (waveSize > 0) { waveSize -= Time.deltaTime * straightenLineSpeed; DrawRopeWaves(); } else { waveSize = 0; DrawRopeNoWaves(); } } }
/// <summary> /// Dessine la corde /// </summary> void DrawRope() { //Si la corde n'est pas droite if (!straightLine) { //Si la position en X de la corde est le même que la position en X du point à accrocher if (m_lineRenderer.GetPosition(precision - 1).x == grapplingGun.grapplePoint.x) { straightLine = true; } else { //Joue les sons playRopeSound(); DrawRopeWaves(); } } else { //Si il n'est pas en train de grapple if (!isGrappling) { //On appelle la méthode grapplingGun.Grapple(); grapplingGun.Grapple(); isGrappling = true; } //Permet de set la wave size en focntion du temps waveSize = (waveSize > 0) ? waveSize -= Time.deltaTime * straightenLineSpeed : 0; m_lineRenderer.positionCount = precision; DrawRopeWaves(); } }
void DrawRope() { if (!straightLine) { if (m_lineRenderer.GetPosition(precision - 1).x == grapplingGun.grapplePoint.x) { straightLine = true; } else { DrawRopeWaves(); } } else { if (!isGrappling) { grapplingGun.Grapple(); isGrappling = true; } waveSize = (waveSize > 0) ? waveSize -= Time.deltaTime * straightenLineSpeed : 0; m_lineRenderer.positionCount = precision; DrawRopeWaves(); } }
//dibujamos con linerenderer y llamamos a las clases de agarre requeridas void DrawRope() { if (!straightLine) { if (m_lineRenderer.GetPosition(precision - 1).x == grapplingGun.grapplePoint.x) { straightLine = true; } else { DrawRopeWaves(); } } else { if (!isGrappling) { if (Input.GetKey(KeyCode.Space)) { grapplingGun.GrappleEnemy(); } else { grapplingGun.Grapple(); } isGrappling = true; } //Control de ondas if (waveSize > 0) { waveSize -= Time.deltaTime * straightenLineSpeed; DrawRopeWaves(); } else { waveSize = 0; if (m_lineRenderer.positionCount != 2) { m_lineRenderer.positionCount = 2; } DrawRopeNoWaves(); } } }