void Init() { audioSources = GetComponents <AudioSource>(); thisRigidbody = GetComponent <Rigidbody>(); thrustParticleSystem = GetComponent <ParticleSystem>(); fishDrones = FindObjectsOfType <FishDrone>(); fishPool = FindObjectOfType <FishPool>(); glueCam = FindObjectOfType <GlueCam>(); musicPlayer = FindObjectOfType <MusicPlayer>(); pickupTracker = FindObjectOfType <PickupTracker>(); pilot = FindObjectOfType <Pilot>(); timeKeeper = FindObjectOfType <Timekeeper>(); uiControl = FindObjectOfType <UIcontrol>(); cockpit = GameObject.FindGameObjectWithTag("Cockpit"); thrusterBell = GameObject.FindGameObjectWithTag("Thruster_Bell"); thrustLight = GameObject.FindGameObjectWithTag("Thruster_Light"); tutorialText = GameObject.FindGameObjectWithTag("Tutorial_Text"); debugMode = Debug.isDebugBuild; startPosition = transform.position; startRotation = transform.rotation; thrustAudioLength = thrustSound.length; thrustAudioTimer = 0 - thrustAudioLength; thrustBubbles = thrustParticleSystem.emission; thrustAudio = audioSources[0]; xAudio = audioSources[1]; casualMode = false; deRotating = false; invulnerable = false; paused = false; thrustAudioTrack = true; tutorialIsVisible = true; AdjustEmissionRate(EMISSION_RATE_INACTIVE); thrustPowerSlider.maxValue = THRUST_MAX; thrustPowerSlider.minValue = THRUST_MIN; thrustPowercapSlider.minValue = 0f; thrustPowercapSlider.maxValue = 1f; thrustPowercapSlider.value = maxPower; SetPower(INITIAL_POWER_LEVEL); DoPowercapUpdate(); gasLevelSlider.maxValue = FUEL_MAX; gasLevelSlider.minValue = 0; gasLevelSlider.value = fuelLevel; DoGasUpdate(); pilotNameText.text = pilot.ID; IndicateMode(); }
private void Start() { if (SumPause.instance == null) { SumPause.instance = this; } else { Destroy(this); } glueCam = FindObjectOfType <GlueCam>(); musicPlayer = FindObjectOfType <MusicPlayer>(); player = FindObjectOfType <Player>(); }