// MonoBehaviour's INTERFACE void Awake() { UIPageDescriptor pageDescriptor = GetComponentInChildren <UIPageDescriptor>(); if (pageDescriptor == null) { return; } m_TriggerProceed = pageDescriptor.GetWidget <UIEventTrigger>(s_WidgetId_TriggerProceed); m_TriggerCancel = pageDescriptor.GetWidget <UIEventTrigger>(s_WidgetId_TriggerCancel); m_GameModeSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_GameModeSelector); m_MatchDurationSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_DurationSelector); m_RefereeSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_RefereeSelector); m_GoldenGoalSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_GoldenGoalSelector); m_AILevelSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_AILevelSelector); m_BallSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_BallSelector); m_StadiumSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_StadiumSelector); InitMatchDurationSelector(); InitRefereeSelector(); InitGoldenGoalSelector(); InitBallSelector(); }
// MonoBehaviour's INTERFACE void Awake() { UIPageDescriptor pageDescriptor = GetComponentInChildren <UIPageDescriptor>(); if (pageDescriptor == null) { return; } m_ResolutionSelector = pageDescriptor.GetWidget <UISelector>(s_WidgetId_ResolutionSelector); m_FullscreenToggle = pageDescriptor.GetWidget <Toggle>(s_WidgetId_FullscreenToggle); m_ApplyButton = pageDescriptor.GetWidget <Button>(s_WidgetId_ApplyButton); m_SfxSlider = pageDescriptor.GetWidget <Slider>(s_WidgetId_SfxSlider); m_MusicSlider = pageDescriptor.GetWidget <Slider>(s_WidgetId_MusicSlider); m_ScreenShakeToggle = pageDescriptor.GetWidget <Toggle>(s_WidgetId_ScreenShakeToggle); //m_SlowMotionToggle = pageDescriptor.GetWidget<Toggle>(s_WidgetId_SlowMotionToggle); m_CameraMovementToggle = pageDescriptor.GetWidget <Toggle>(s_WidgetId_CameraMovementToggle); m_XInputToggle = pageDescriptor.GetWidget <Toggle>(s_WidgetId_XInputToggle); m_RumbleToggle = pageDescriptor.GetWidget <Toggle>(s_WidgetId_RumbleToggle); InitResolutionSelector(); }
// MonoBehaviour's interface void Awake() { m_Gamepads = new List <tnUIGamepad>(); m_Phones = new List <tnUIPhone>(); UIPageDescriptor pageDescriptor = GetComponentInChildren <UIPageDescriptor>(); if (pageDescriptor != null) { m_TriggerProceed = pageDescriptor.GetWidget <UIEventTrigger>(s_ProceedTrigger); m_TriggerCancel = pageDescriptor.GetWidget <UIEventTrigger>(s_CancelTrigger); } InitializeGrids(); }
// MonoBehaviour's INTERFACE void Awake() { // Initialize Controlling map. for (int index = 0; index < s_MaxPlayers; ++index) { IndexList indexList = new IndexList(); m_ControllingMap.Add(indexList); } // Get widgets. UIPageDescriptor pageDescriptor = GetComponentInChildren <UIPageDescriptor>(); if (pageDescriptor != null) { m_TriggerProceed = pageDescriptor.GetWidget <UIEventTrigger>(s_WidgetId_ProceedTrigger); m_TriggerCancel = pageDescriptor.GetWidget <UIEventTrigger>(s_WidgetId_CancelTrigger); } // Create and setup slots. if (m_LayoutGroup == null || m_SlotPrefab == null) { return; } // Configure grid layout. RectTransform slotPrefabTransform = m_SlotPrefab.GetComponent <RectTransform>(); if (slotPrefabTransform != null) { m_LayoutGroup.cellSize = new Vector2(slotPrefabTransform.rect.width, slotPrefabTransform.rect.height); } // Spawn slots. List <int> teamKeys = tnGameData.GetTeamsKeysMain(); foreach (int key in teamKeys) { GameObject slotInstance = (GameObject)Instantiate(m_SlotPrefab); slotInstance.SetParent(m_LayoutGroup.gameObject, true); tnTeamFlag teamFlag = slotInstance.GetComponent <tnTeamFlag>(); if (teamFlag != null) { // Set Team Id. teamFlag.SetTeamId(key); // Set flag image and team name. tnTeamData teamData = tnGameData.GetTeamDataMain(key); teamFlag.SetImage(teamData.flag); teamFlag.SetLabel(teamData.name); } m_Slots.Add(slotInstance); } }