public void FocusRematchButton() { if (m_RematchButton != null) { UIEventSystem.SetFocusMain(m_RematchButton.gameObject); } }
public void FocusMainMenuButton() { if (m_MainMenuButton != null) { UIEventSystem.SetFocusMain(m_MainMenuButton.gameObject); } }
/// <summary> /// 初始化 /// </summary> private void Initialize() { //管理类单例 m_manage = UIManage.Instance; m_SceneManage = SceneStateController.Instance; //系统 uiEvent = new UIEventSystem(this); stageSystem = new StageSystem(this); cardManage = new CardManageSystem(this); attackSystem = new AttackSystem(this); //其他 serialize = new Serialize(this); deserialization = Deserialization.Instance; }
private void UpdateFocusTo(GameObject i_Root) { if (i_Root == null) { return; } GameObject newFocus = i_Root.FindChildWithTag("Focus"); if (newFocus != null) { UIEventSystem.SetFocusMain(newFocus); } }
void Start() { _eventSystem = new UIEventSystem(); _eventSystem.Init(); _eventSystem.Trans.SetParent(transform); SaleDataManager.Instance.Init(); gameObject.AddComponent <SocialGUIManager>(); SocialGUIManager.Instance.OpenUI <UICtrlMainApp>(); _run = true; LogHelper.Info("App Run!"); // if (!Application.isEditor) // { // Application.wantsToQuit += OnWantsQuit; // } }
// make persistent void Awake() { #region Singleton Behaviour /* Singleton behaviour. */ if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(gameObject); Destroy(this); return; } #endregion DontDestroyOnLoad(gameObject); }
private void RemoveFocusFrom(GameObject i_Root) { if (i_Root == null) { return; } GameObject currentFocus = UIEventSystem.focusMain; if (currentFocus != null) { if (i_Root.transform.HasChild(currentFocus)) { UIEventSystem.SetFocusMain(null); } } }
public override void OnEnter() { UIEventSystem.SetFocusMain(FindFirstEnabledSelectable(target)); Finish(); }
public override void OnEnter() { UIEventSystem.InitializeMain(); Finish(); }
public override void OnEnter() { UIEventSystem.SetFocusMain(null); Finish(); }
public override void OnEnter() { // Create background camera. { GameObject cameraGo = new GameObject("BackgroundCamera"); cameraGo.transform.position = new Vector3(0f, 0f, -10f); Camera camera = cameraGo.AddComponent <Camera>(); camera.clearFlags = CameraClearFlags.SolidColor; camera.backgroundColor = Color.black; camera.cullingMask = 0; camera.orthographic = true; camera.orthographicSize = 5f; camera.depth = -1f; camera.useOcclusionCulling = false; camera.allowHDR = false; GameObject.DontDestroyOnLoad(cameraGo); } // Initialize Input system. { InputSystem.InitializeMain(); InputSystem.AddPlayerMain("Player0"); InputSystem.AddPlayerMain("Player1"); InputSystem.AddPlayerMain("Player2"); InputSystem.AddPlayerMain("Player3"); InputSystem.AddPlayerMain("Player4"); InputSystem.AddPlayerMain("Player5"); InputSystem.AddPlayerMain("Player6"); InputSystem.AddPlayerMain("Player7"); InputSystem.RefreshMapsMain(); } // Initialize WiFi Input system. { WiFiInputSystem.InitializeMain(); } // Init systems. { Messenger.Cleanup(); GameModulesManager.InitializeMain(); ObjectPool.InitializeMain(); MusicPlayer.InitializeMain(); if (musicPlayerOutputChannel != null && !musicPlayerOutputChannel.IsNone && musicPlayerOutputChannel.Value != null) { MusicPlayer.SetChannelMain((AudioMixerGroup)musicPlayerOutputChannel.Value); } // TODO: Set MusicPlayer output channel. SfxPlayer.InitializeMain(); AudioMixerManager.InitializeMain(); if (audioMixerSnapshot != null && !audioMixerSnapshot.IsNone && audioMixerSnapshot.Value != null) { AudioMixerManager.SetSnapshotMain((AudioMixerSnapshot)audioMixerSnapshot.Value, 0f); } GameServices.InitializeMain(); GameSettings.InitializeMain(); UIEventSystem.InitializeMain(); } // Init UI. { GameObject uiCamera = new GameObject("UICamera"); Camera cam = uiCamera.AddComponent <Camera>(); cam.clearFlags = CameraClearFlags.Depth; cam.cullingMask = 0; cam.cullingMask |= (1 << LayerMask.NameToLayer("UI")); cam.cullingMask |= (1 << LayerMask.NameToLayer("GUI")); cam.orthographic = true; cam.orthographicSize = 5f; cam.depth = float.MaxValue; cam.useOcclusionCulling = false; cam.allowHDR = false; /* FixedAspectRatio fixedAspectRatio = */ uiCamera.AddComponent <FixedAspectRatio>(); // fixedAspectRatio.targetAspectRatio = 1920f / 1080f; // uiCamera.AddComponent<GUILayer>(); GameObject.DontDestroyOnLoad(uiCamera); GameObject uiCanvas = new GameObject("UICanvas"); uiCanvas.layer = LayerMask.NameToLayer("UI"); Canvas canvas = uiCanvas.AddComponent <Canvas>(); canvas.renderMode = RenderMode.ScreenSpaceCamera; canvas.pixelPerfect = false; canvas.worldCamera = cam; uiCanvas.AddComponent <UICanvas>(); CanvasScaler canvasScaler = uiCanvas.AddComponent <CanvasScaler>(); canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; canvasScaler.referenceResolution = new Vector2(1920, 1080); canvasScaler.screenMatchMode = CanvasScaler.ScreenMatchMode.Expand; canvasScaler.referencePixelsPerUnit = 100; GraphicRaycaster graphicRaycaster = uiCanvas.AddComponent <GraphicRaycaster>(); graphicRaycaster.ignoreReversedGraphics = true; uiCanvas.tag = "MainCanvas"; GameObject.DontDestroyOnLoad(uiCanvas); } // PlayMaker Proxy. { GameObject playmakerProxy = new GameObject("PlayMaker Proxy"); GameObject playmakerGUIPrefab = (GameObject)Resources.Load("Core/PlayMakerGUI"); if (playmakerGUIPrefab != null) { GameObject playmakerGUI = (GameObject)GameObject.Instantiate(playmakerGUIPrefab, Vector3.zero, Quaternion.identity); playmakerGUI.SetParent(playmakerProxy); } GameObject playmakerUGUIProxyPrefab = (GameObject)Resources.Load("Core/PlayMakerUGUI"); if (playmakerUGUIProxyPrefab != null) { GameObject playmakerUGUIProxy = (GameObject)GameObject.Instantiate(playmakerUGUIProxyPrefab, Vector3.zero, Quaternion.identity); playmakerUGUIProxy.SetParent(playmakerProxy); } GameObject.DontDestroyOnLoad(playmakerProxy); } Finish(); }