//TODO fix all of these uses of delta time, which is usually false on the first frame anyway void Explode(float deltaTime) { Vector3 gravity = Physics.gravity; //TODO get actual gravity from parent projectile. better yet, implement getpos from proj Vector3 position = PhysicsTools.GetPosition(prevPosition, prevVelocity, gravity, deltaTime); ExplosionManager.instance.GetItem(position, data.explosion.range); }
void FireAt(float deltaTime, Quaternion direction, float speed) { //calculate real position in this frame //TODO use projectile to also get _lastTime ??? //If I want an actual replayability, this is gonna be a mess Vector3 gravity = Physics.gravity; //TODO get actual gravity from parent projectile Vector3 position = PhysicsTools.GetPosition(prevPosition, prevVelocity, gravity, deltaTime); for (int i = 0; i < data.shot.rate; i++) { ProjectileManager.instance.InitProjectile(this, position, transform.rotation, currentTime, data.projectile, data.effect); } }