private void LevelClearEvent(StandardLevelScenesTransitionSetupDataSO data, LevelCompletionResults result) { var _mainGameSceneSetupData = BS_Utils.Plugin.LevelData; var _beatmapData = _mainGameSceneSetupData?.GameplayCoreSceneSetupData?.difficultyBeatmap?.beatmapData; if (_beatmapData != null) { var songDuration = _mainGameSceneSetupData?.GameplayCoreSceneSetupData?.difficultyBeatmap?.level?.beatmapLevelData?.audioClip?.length ?? -1f; var songName = _mainGameSceneSetupData.GameplayCoreSceneSetupData.difficultyBeatmap.level.songName; DiaryData.LevelCleared(songName, songDuration, _beatmapData.notesCount); } string date = DateTime.Now.ToString("yyyy_MM_dd_"); String filepath = "D:/BeatSaberMod/" + date + "record.csv"; DiaryData.WritePlayData(filepath); DiaryData.Update(); List <Vector2> goodGraph = DiaryData.GetLastGoodRateGraphPoint(); Log.Write("LevelClearEvent goodGraph Count = " + goodGraph.Count.ToString()); floatingScreenForScore.rootViewController.gameObject.SetActive(true); floatingScreenForScore.GetComponent <GraphContainer>().gameObject.SetActive(true); floatingScreenForScore.GetComponent <GraphContainer>().Draw(DiaryData.GetLastGoodRateGraphPoint()); }
private static IEnumerator SetGoodRateChart_Process() { yield return(new WaitForEndOfFrame()); Log.Write("SetFloatingDisplay Start"); Vector3 ChartStandardLevelPosition = new Vector3(0, 0.25f, 2.25f); /* Original: 0, -0.4, 2.25 */ Vector3 ChartStandardLevelRotation = new Vector3(35, 0, 0); var pos = ChartStandardLevelPosition; var rot = Quaternion.Euler(ChartStandardLevelRotation); floatingScreenForScore = FloatingScreen.CreateFloatingScreen(new Vector2(105, 65), false, pos, rot); floatingScreenForScore.SetRootViewController(BeatSaberUI.CreateViewController <GoodRateViewController>(), true); Image image = floatingScreenForScore.GetComponent <Image>(); image.enabled = false; GraphContainer graph = floatingScreenForScore.gameObject.AddComponent <GraphContainer>(); floatingScreenForScore.rootViewController.gameObject.SetActive(false); graph.gameObject.SetActive(false); }
private void SetupScreens() { if (_chatScreen == null) { var screenSize = new Vector2(ChatWidth, ChatHeight); _chatScreen = FloatingScreen.CreateFloatingScreen(screenSize, true, ChatPosition, Quaternion.identity, 0f, true); var rectMask2D = _chatScreen.GetComponent <RectMask2D>(); if (rectMask2D) { Destroy(rectMask2D); } _chatContainer = new GameObject("chatContainer"); _chatContainer.transform.SetParent(_chatScreen.transform, false); _chatContainer.AddComponent <RectMask2D>().rectTransform.sizeDelta = screenSize; var canvas = _chatScreen.GetComponent <Canvas>(); canvas.sortingOrder = 3; _chatScreen.SetRootViewController(this, AnimationType.None); _rootGameObject = new GameObject(); DontDestroyOnLoad(_rootGameObject); _chatMoverMaterial = Instantiate(BeatSaberUtils.UINoGlowMaterial); _chatMoverMaterial.color = Color.clear; var renderer = _chatScreen.handle.gameObject.GetComponent <Renderer>(); renderer.material = _chatMoverMaterial; renderer.material.mainTexture = _chatMoverMaterial.mainTexture; _chatScreen.transform.SetParent(_rootGameObject.transform); _chatScreen.ScreenRotation = Quaternion.Euler(ChatRotation); _bg = _chatScreen.GetComponentInChildren <ImageView>(); _bg.material = Instantiate(_bg.material); _bg.material.mainTexture = BeatSaberUtils.UINoGlowMaterial.mainTexture; _bg.color = BackgroundColor; AddToVRPointer(); UpdateChatUI(); } }
public void Initialize() { _floatingScreen = FloatingScreen.CreateFloatingScreen(new Vector2(150f, 50f), false, _clockSettings.Position, Quaternion.Euler(_clockSettings.Rotation)); _floatingScreen.GetComponent <VRGraphicRaycaster>().SetField("_physicsRaycaster", _physicsRaycasterWithCache); //_floatingScreen.GetComponent<Image>().enabled = false; _floatingScreen.SetRootViewController(_basicClockView, HMUI.ViewController.AnimationType.Out); _disabled = !_clockSettings.Enabled; _clockSettings.MarkDirty(); ClockController_DateUpdated(DateTime.Now); _clockController.DateUpdated += ClockController_DateUpdated; }
private void PauseMenuManager_didPressContinueButtonEvent() { controllerOffsetPresetsModalController.OnDeactivate(); controllerOffsetSettingsModalController.OnDeactivate(); if (floatingScreenCanvasGroup == null) { floatingScreenCanvasGroup = floatingScreen.GetComponent <CanvasGroup>(); } if (floatingScreenCanvasGroup != null) { floatingScreenCanvasGroup.alpha = 1; } }
private void SetupScreens() { if (_chatScreen == null) { _chatScreen = FloatingScreen.CreateFloatingScreen(new Vector2(ChatWidth, ChatHeight), true, ChatPosition, Quaternion.Euler(ChatRotation)); var canvas = _chatScreen.GetComponent <Canvas>(); canvas.sortingOrder = 3; _chatScreen.SetRootViewController(this, true); _rootGameObject = new GameObject(); DontDestroyOnLoad(_rootGameObject); _chatMoverMaterial = Instantiate(BeatSaberUtils.UINoGlowMaterial); _chatMoverMaterial.color = Color.clear; var renderer = _chatScreen.handle.gameObject.GetComponent <Renderer>(); renderer.material = _chatMoverMaterial; _chatScreen.transform.SetParent(_rootGameObject.transform); _bg = _chatScreen.gameObject.GetComponent <UnityEngine.UI.Image>(); _bg.material = Instantiate(BeatSaberUtils.UINoGlowMaterial); _bg.color = BackgroundColor; AddToVRPointer(); } }