// Update is called once per frame void Update() { float cur_angle = transform.rotation.eulerAngles.y; // upAngle.setCurrentAngle(cur_angle); rightAngle.setCurrentAngle(cur_angle); // getHitGameObject(rightAngle); }
void setAngleToRight(AngleUnit in_angleUnit) { float new_angle = in_angleUnit.getCurrentAngleBase() + 90; if (new_angle > 360) { new_angle %= 360; } in_angleUnit.setCurrentAngle(new_angle); }
void setAngleToLeft(AngleUnit in_angleUnit) { float new_angle = in_angleUnit.getCurrentAngleBase() - 90; if (new_angle > 360) { new_angle %= 360; } if (new_angle < 0) { new_angle += 360; } in_angleUnit.setCurrentAngle(new_angle); }