private static void CreateTouchManager() { if (FindObjectOfType <TouchManagerSpriteRenderer>() && !tckGUIobj) { tckGUIobj = FindObjectOfType <TouchManagerSpriteRenderer>().gameObject; } if (tckGUIobj) { return; } tckGUIobj = new GameObject(mainGOName, typeof(TouchManagerSpriteRenderer)); GuiCamera.CreateCamera(tckGUIobj.transform, 1, 10f); }
private static void CreateTouchManager() { if (FindObjectOfType <TouchManagerUgui>() && !tckGUIobj) { tckGUIobj = FindObjectOfType <TouchManagerUgui>().gameObject; } if (tckGUIobj) { return; } tckGUIobj = new GameObject(mainGOName, typeof(Canvas), typeof(GraphicRaycaster), typeof(CanvasScaler), typeof(TouchManagerUgui)); tckGUIobj.layer = LayerMask.NameToLayer("UI"); GuiCamera.CreateCamera(tckGUIobj.transform, 32, 100f); tckGUIobj.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceCamera; tckGUIobj.GetComponent <Canvas>().worldCamera = GuiCamera.guiCamera; tckGUIobj.GetComponent <CanvasScaler>().uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; }