// Start is called before the first frame update void Start() { terrain = Terrain.GetReference(); manager = GameManager.GetReference(); cameraEffects = CameraEffects.GetReference(); PrevY = transform.position.y; }
// Update is called once per frame void Update() { if (ParticleTimerSeconds > 0) { ParticleTimer -= Time.deltaTime; if (ParticleTimer <= 0f) { ParticleTimerSeconds--; ParticleTimer = 1f; if (ParticleTimerSeconds > 4) { int spark = Random.Range(0, SparkParticles.Count); SparkParticles[spark].Play(); SparkSounds[spark].Play(); } if (ParticleTimerSeconds == 4) { for (int i = 0; i < ExplosionParticles.Count; i++) { ExplosionParticles[i].Play(); } CameraEffects.GetReference().Shake(0.5f); ExplosionAudio.Play(); } if (ParticleTimerSeconds <= 1) { SmokeParticles.Stop(); } } } }
// Start is called before the first frame update void Start() { TrajectoryLine.positionCount = NumTrajectoryPoints; MyHoverText.text = TankName + " : " + OnlineNumber + "\nHealth: " + Health.ToString("0.00"); MyWheels = new List <TankWheel>(); MyWheels.AddRange(GetComponentsInChildren <TankWheel>()); CrossHairs = new List <Crosshair>(); CrossHairs.AddRange(CrossHairParent.GetComponentsInChildren <Crosshair>()); PrevX = transform.position.x; PrevTurretRot = TurretPivot.rotation.z; cameraEffects = CameraEffects.GetReference(); }
// Start is called before the first frame update void Start() { MyAudio = GetComponent <AudioSource>(); darkness = DarkOverlay.GetReference(); cameraEffects = CameraEffects.GetReference(); }