void Update() { if (shotIndex >= shotTimes.Length) { this.enabled = false; return; } float shotTime = shotTimes[shotIndex]; if (Time.timeSinceLevelLoad >= shotTime) { Debug.Log(wanderer.transform.position); // Fire! barrelControl.platformRotation = platformRotations[shotIndex]; barrelControl.barrelElevation = barrelElevations[shotIndex]; Debug.Log($"Time to hit: {barrelControl.GetEstimatedShotLandingTime()}"); //if (shotIndex == 9) //Debug.Log(wanderer.transform.position); barrelControl.Fire(); shotIndex++; } }
void Update() { if (shotIndex >= shotTimes.Length) { this.enabled = false; return; } float shotTime = shotTimes[shotIndex]; if (Time.timeSinceLevelLoad >= shotTime) { // Fire! barrelControl.platformRotation = platformRotations[shotIndex]; barrelControl.barrelElevation = barrelElevations[shotIndex]; barrelControl.Fire(); shotIndex++; } }