// Use this for initialization void Start() { Random.InitState(System.DateTime.Now.Second); commentController = GameObject.Find("Comment").GetComponent <CommentController>(); skillTipBarController = GameObject.Find("SkillTipArea").GetComponent <UISkillTipBarController>(); uiBarController = GameObject.Find("BarArea").GetComponent <UIBarController>(); playerBattleInfo = playerBattleUIPos.GetComponentInChildren <UIBattleInfo>(); enemyBattleInfo = enemyBattleUIPos.GetComponentInChildren <UIBattleInfo>(); FinishedStorySteps = new List <string>(); InputSequenceController.Instance.ResetAvailable(); UIWindowController.Instance.mainMenu.Open(); SoundController.Instance.FMODmusic.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); //此处有个坑,FMODInstance必须创建完成才能获取channelgroup state = GameState.Wait; }
// Start is called before the first frame update private void Start() { //Get UI elements textComponents = gameObject.GetComponentsInChildren <Text>(); throttleText = textComponents.First(x => x.gameObject.name == "throttle_text"); batteryText = textComponents.First(x => x.gameObject.name == "battery_text"); headingText = textComponents.First(x => x.gameObject.name == "heading_text"); elevationText = textComponents.First(x => x.gameObject.name == "elevation_text"); airspeedText = textComponents.First(x => x.gameObject.name == "airspeed_text"); altitudeText = textComponents.First(x => x.gameObject.name == "altitude_text"); rpmText = textComponents.First(x => x.gameObject.name == "rpm_text"); engineStatusTexts = textComponents.ToList().FindAll(x => x.gameObject.name.Contains("engine_")); verticalSpeedText = textComponents.First(x => x.gameObject.name == "vsi_text"); //Get throttle bar and create a controller throttleBar = GameObject.Find("throttle_bar").GetComponent <RectTransform>(); throttleBarController = new UIBarController(throttleBar, 100, UIBarController.BarDirection.Vertical, 5); //Get internal screens and door panels internalScreensRenderers = gameObject.GetComponentsInChildren <Renderer>().ToList().FindAll(x => x.gameObject.name.Contains("canopy_int")); Renderer tmp = GameObject.Find("door_panel.001").GetComponent <Renderer>(); internalScreensRenderers.Add(tmp); tmp = GameObject.Find("door_panel.002").GetComponent <Renderer>(); internalScreensRenderers.Add(tmp); //Get mesh elements meshComponents = gameObject.GetComponentsInChildren <Transform>().ToList().FindAll(x => !x.gameObject.name.Contains("canopy")); artificialHorizon = meshComponents.First(x => x.gameObject.name == "artificial_horizon"); headingIndicator = meshComponents.First(x => x.gameObject.name == "heading_indicator_slider"); elevationIndicator = meshComponents.First(x => x.gameObject.name == "elevation_indicator_slider"); altitudeIndicator = meshComponents.First(x => x.gameObject.name == "altitude_meter"); verticalSpeedIndicator = meshComponents.First(x => x.gameObject.name == "vsi_indicator"); directionIndicator = meshComponents.First(x => x.gameObject.name == "direction_arrow"); menuController = gameObject.GetComponent <MenuController>(); //Get canvas groups menuUI = GameObject.Find("Menu_UI").GetComponent <CanvasGroup>(); dataUI = GameObject.Find("Data_UI").GetComponent <CanvasGroup>(); manualControlUI = GameObject.Find("Manual_Control_UI").GetComponent <CanvasGroup>(); //Hide UI before startup HideAllUI(); SetStartInterface(); }
private void Awake() { energy = maxEnergy; barController = energyBar.GetComponent <UIBarController>(); }
private void Awake() { health = maxHealth; barController = healthBar.GetComponent <UIBarController>(); }
private void Awake() { _instance = this; }