Esempio n. 1
0
        public void SetActiveGoodRateChart(bool onoff, Transform transform)
        {
            if (floatingScreenForScore == null)
            {
                Log.Write("floatingScreenForScore is Null"); return;
            }

            if (onoff)
            {
                floatingScreenForScore.transform.position = transform.position + new Vector3(0f, 0f, -2.2f);
                floatingScreenForScore.transform.rotation = Quaternion.Euler(new Vector3(0, 105, 0));
            }
            else
            {
                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.transform.position = pos;
                floatingScreenForScore.transform.rotation = rot;
            }

            floatingScreenForScore.rootViewController.gameObject.SetActive(onoff);
            floatingScreenForScore.GetComponent <GraphContainer>().gameObject.SetActive(onoff);
            floatingScreenForScore.GetComponent <GraphContainer>().Draw(DiaryData.GetLastGoodRateGraphPoint());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        private void Awake()
        {
            var assembly = Assembly.GetExecutingAssembly();

            using (var stream = assembly.GetManifestResourceStream("BeatSaberDiary.UI.linegraph"))
                assetBundle = AssetBundle.LoadFromStream(stream);

            var prefab = assetBundle.LoadAsset <GameObject>("LineGraph");
            var sprite = assetBundle.LoadAsset <Sprite>("Circle");
            var go     = Instantiate(prefab, transform);

            winGraph = go.AddComponent <WindowGraph>();
            winGraph.circleSprite          = sprite;
            winGraph.transform.localScale /= 10;

            List <Vector2> goodGraph = DiaryData.GetLastGoodRateGraphPoint();

            Log.Write("GraphContainer goodGraph Count = " + goodGraph.Count.ToString());
            if (goodGraph.Count > 0)
            {
                Draw(goodGraph);
            }
            else
            {
                //Draw(new List<Vector2> { new Vector2(0f, 1f), new Vector2(1f, 2f), new Vector2(3f, 0f), new Vector2(4f, 5f) });
            }
        }