
It looks like you're new here. If you want to get involved, click one of these buttons!
var numShots = 5; // Number of shots fired (should be odd);
var spreadAngle = 2.0; // Angle between shots
var timeBetweenShots = 0.5; // Minimum time between shots
private var nextShot = 0.0;
function Start() {
if (numShots / 2 * 2 == numShots) numShots++; // Need an odd number of shots
if (numShots < 3) numShots = 3; // At least 3 shots for a fan
}
function Update () {
if(Input.GetKeyDown(KeyCode.Space) && Time.time > nextShot){
nextShot = Time.time + timeBetweenShots;
var qAngle = Quaternion.AngleAxis(-numShots / 2.0 * spreadAngle, transform.up) * transform.rotation;
var qDelta = Quaternion.AngleAxis(spreadAngle, transform.up);
for (var i = 0; i < numShots; i++) {
var go : GameObject = Instantiate(playerProjectile, transform.position,qAngle);
go.rigidbody.AddForce(go.transform.forward * 1000.0);
qAngle = qDelta * qAngle;
}
}
}
Can someone pls convert this java script to c#. I don't want the whole I just want
nextShot = Time.time + timeBetweenShots;
var qAngle = Quaternion.AngleAxis(-numShots / 2.0 * spreadAngle, transform.up) * transform.rotation;
var qDelta = Quaternion.AngleAxis(spreadAngle, transform.up);
Thanks
Answers
Thank u.
I appreciate your help.
The source code for instance .java report has been composed and changed over totally to bytecode. Bytecode can be run on any machine that has a Java virtual machine. Java virtual machine changes the bytecode into code that is PC gear runnable.
A huge piece of the other programming vernaculars, for instance, COBOL, C++, Smalltalk or Visual Basic gather most of the code into twofold records. Twofold records are stage subordinate for instance programs made game plans for Intel-based Windows machines can't be run on Linux-based machines or Macs.
Job Oriented Java Certification Course in Pune
In short, ethical design (to us) meant achieving wellbeing for each user and an equitable value distribution within society through a design that can be sustained by our living planet. When we introduced these objectives in the company, for many colleagues, design ethics and responsible design suddenly became tangible and achievable through practical—and even familiar—actions https://mlsdev.com/blog/how-to-create-social-media-app