Game Development Reference
In-Depth Information
f_inAirTime = 0.0;
f_inAirStartTime = Time.time;
} else {
f_verticalSpeed -= gravity * Time.deltaTime; //if our
character in the air
//Count Time
f_inAirTime = Time.time - f_inAirStartTime;
}
// Calculate actual motion
v3_movement = Vector3 (0, f_verticalSpeed, 0); // Apply the
vertical speed if character fall down
v3_movement *= Time.deltaTime;
//Checking if the character is playing the shoot animation
if (!b_isPrepare) {
b_isShot = false;
//Play the shot preparing animation function
WaitForPrepare();
} else {
if (v3_rocketDirection == v3_moveDirection) {
if (!b_isShot) {
b_isShot = true;
//Play the shoot animation function
WaitForShot();
}
}
}
// Move the controller
c_collisionFlags = controller.Move(new Vector3(0, v3_
movement.y, 0));
//Update rotation of the character
transform.rotation = Quaternion.LookRotation(v3_
moveDirection);
}
 
Search WWH ::




Custom Search