public void shootPosition(string jointOneName, string jointTwoName, string side) { /* Recibe como entrada la posicion de salida de la pelota * para decidir que indicador entra en estado de espera o activo "ControllerIndicator(jointOneName);"*/ ControllerIndicator(jointOneName); if (gameM.shootOpt == 3) { counterPlane(); } Debug.Log("plano" + gameM.plane); float angleRad = calc.setRamdomAngle(side, gameM.plane); Vector3 pointOne = GameObject.FindGameObjectWithTag(jointOneName).transform.position; Vector3 pointTwo = GameObject.FindGameObjectWithTag(jointTwoName).transform.position; Debug.Log("point ini 1"); Debug.Log(pointIni); this.pointFin = calc.getPosition(pointOne, calc.createPointTwoShoulderAF(pointOne, pointTwo), angleRad, 0.0f, gameM.plane); Debug.Log("point fin 1"); Debug.Log(pointFin); this.pointFin = pointFinal(pointIni, pointFin, -60.0f); Debug.Log("point fin 2"); Debug.Log(pointFin); //gameObject.transform.position = pointFin; gameM.NewRepetition(); }
public void shootPosition(string jointOneName, string jointTwoName, string side) { float angleRad = 0.0f; if (calc != null) { angleRad = calc.setRamdomAngle(side, "z"); } else { Debug.Log("no existe"); } Vector3 pointOne = GameObject.FindGameObjectWithTag(jointOneName).transform.position; Debug.Log("PointOne: " + pointOne); Vector3 pointTwo = GameObject.FindGameObjectWithTag(jointTwoName).transform.position; Debug.Log("PointTwo: " + pointTwo); pointFin = calc.getPositionWithCross(pointOne, calc.createPointTwoShoulderAF(pointOne, pointTwo), angleRad); Debug.Log("PointFin: " + pointFin); }
/*Caslcula la posicion de salida y llegada del balon */ public void shootPosition(string jointOneName, string jointTwoName, string side) { if (gameM.shootOpt == 3) { counterPlane(); } Debug.Log("plano" + gameM.plane); float angleRad = calc.setRamdomAngle(side, gameM.plane); Vector3 pointOne = GameObject.FindGameObjectWithTag(jointOneName).transform.position; Vector3 pointTwo = GameObject.FindGameObjectWithTag(jointTwoName).transform.position; Debug.Log("point ini 1"); Debug.Log(pointIni); this.pointFin = calc.getPosition(pointOne, calc.createPointTwoShoulderAF(pointOne, pointTwo), angleRad, 0.0f, gameM.plane); Debug.Log("point fin 1"); Debug.Log(pointFin); this.pointFin = pointFinal(pointIni, pointFin, -60.0f); Debug.Log("point fin 2"); Debug.Log(pointFin); gameM.NewRepetition(); }