// void Awake() { // if (pushDirection == PushDirection.Backward) { direction = -1; } else if (pushDirection == PushDirection.forward) { direction = 1; } controlBoard = GameObject.FindGameObjectWithTag("GameController").GetComponent <SilantroControls> (); panelControls = GameObject.FindGameObjectWithTag("PanelControls").GetComponent <PanelControls> (); if (controlBoard == null) { Debug.LogError("Control Board is missing, Place Control Board in scene and restart!"); } brake = controlBoard.BrakeHoldRelease; gearActivate = controlBoard.LandingGear; GameObject attachee = new GameObject(); attachee.transform.parent = this.transform; attachee.transform.localPosition = new Vector3(0, 0, 0); attachee.transform.name = "Mechanical Sounds"; mechanicalSounds = attachee.AddComponent <AudioSource>(); brakeActivated = true; // }
IEnumerator ControlesCo() { yield return(new WaitForSeconds(0.5f)); MainPanel.SetActive(false); PanelControls.SetActive(true); }
internal void startGameButton_Click(object sender, EventArgs e) { if (PanelControls.setupFlag == true) { SetStyle(ControlStyles.SupportsTransparentBackColor, true); InitialSetups.preliminarySetup(this); } PanelControls.toggleGamePanel(this); }
internal void KeyPressCases(object sender, KeyPressEventArgs e) { PanelControls.genericKeyPress(sender, e, this); }
internal void endTurnButton_Click(object sender, EventArgs e) { PanelControls.endTurnButtonClick(this, sender, e); }
internal List <Button> buttonList; //keeps track of buttons in the interface. should be added to GUIstate public GUI() { InitializeComponent(); SoundEffectPlayer.soundSetup(); PanelControls.menuSetup(this); //initialize menu }
void Awake() { // //ADD AUDIOSOURCES if (null != EngineStartSound) { EngineStart = Thruster.gameObject.AddComponent <AudioSource>(); EngineStart.clip = EngineStartSound; EngineStart.loop = false; EngineStart.dopplerLevel = 0f; EngineStart.spatialBlend = 1f; EngineStart.rolloffMode = AudioRolloffMode.Custom; EngineStart.maxDistance = 650f; } if (null != EngineIdleSound) { GameObject soundPoint = new GameObject(); soundPoint.transform.parent = this.transform; soundPoint.transform.localPosition = new Vector3(0, 0, 0); soundPoint.name = this.name + " Sound Point"; // EngineRun = soundPoint.gameObject.AddComponent <AudioSource>(); EngineRun.clip = EngineIdleSound; EngineRun.loop = true; EngineRun.Play(); engineSoundVolume = EngineRun.volume * 2f; EngineRun.spatialBlend = 1f; EngineRun.dopplerLevel = 0f; EngineRun.rolloffMode = AudioRolloffMode.Custom; EngineRun.maxDistance = 600f; } if (null != EngineShutdownSound) { EngineShutdown = Thruster.gameObject.AddComponent <AudioSource>(); EngineShutdown.clip = EngineShutdownSound; EngineShutdown.loop = false; EngineShutdown.dopplerLevel = 0f; EngineShutdown.spatialBlend = 1f; EngineShutdown.rolloffMode = AudioRolloffMode.Custom; EngineShutdown.maxDistance = 650f; } // GameObject brain = GameObject.FindGameObjectWithTag("Brain"); if (brain.transform.root == gameObject.transform.root) { instrumentation = brain.GetComponent <SilantroInstrumentation> (); } if (instrumentation == null) { Debug.LogError("Instrumentation System is Missing!! Add COG to aircraft"); } else { instrumentation.boom = EngineRun; } // controlBoard = GameObject.FindGameObjectWithTag("GameController").GetComponent <SilantroControls> (); panelControls = GameObject.FindGameObjectWithTag("PanelControls").GetComponent <PanelControls> (); if (controlBoard == null) { Debug.LogError("Control Board is missing, Place Control Board in scene and restart!"); } startEngine = controlBoard.engineStart; stopEngine = controlBoard.engineShutdown; throttleUp = controlBoard.engineThrottleUp; throttleDown = controlBoard.engineThrottleDown; afterburnerControl = controlBoard.AfterburnerControl; // LPIdleRPM = LowPressureFanRPM * 0.1f; HPIdleRPM = HighPressureFanRPM * 0.09f; // if (reheatSystem == ReheatSystem.Afterburning) { canUseAfterburner = true; } else if (reheatSystem == ReheatSystem.noReheat) { canUseAfterburner = false; } // AfterburnerOperative = false; }