Пример #1
0
        private void SpawnController_ScaleRemoveCut(BeatmapObjectSpawnController arg1, NoteController controller, NoteCutInfo arg3)
        {
            NoteData  note          = controller.noteData;
            Transform noteTransform = controller.GetField <Transform>("_noteTransform");

            //      Log("DESPAWN" + noteTransform.localScale.ToString());
            if (noteTransform.localScale.x != 1)
            {
                noteTransform.localScale = new Vector3(1f, 1f, 1f);
            }
            //          Log("DESPAWN" + noteTransform.localScale.ToString());



            //     if (modifiedNotes[note.id] != null)
            //          note = modifiedNotes[note.id];

            FloatBehavior behavior = noteTransform.gameObject.GetComponent <FloatBehavior>();

            if (behavior != null)
            {
                noteTransform.localPosition = new Vector3(behavior.originalX, behavior.originalY, noteTransform.localPosition.z);
                GameObject.Destroy(behavior);
            }
        }
Пример #2
0
        public static void SpawnController_ScaleRemoveMiss(NoteController controller)
        {
            NoteData  note          = controller.noteData;
            Transform noteTransform = controller.noteTransform;

            if (noteTransform?.localScale.x != 1)
            {
                noteTransform.localScale = new Vector3(1f, 1f, 1f);
            }
            FloatBehavior behavior = noteTransform?.gameObject.GetComponent <FloatBehavior>();

            if (behavior != null)
            {
                noteTransform.localPosition = new Vector3(behavior.originalX, behavior.originalY, noteTransform.localPosition.z);
                GameObject.Destroy(behavior);
            }
        }
Пример #3
0
        private void SpawnController_ScaleRemoveMiss(BeatmapObjectSpawnController arg1, INoteController controller)
        {
            //         Log(songAudio.time.ToString());
            NoteData  note          = controller.noteData;
            Transform noteTransform = controller.noteTransform;

            //      Log("DESPAWN" + noteTransform.localScale.ToString());
            if (noteTransform?.localScale.x != 1)
            {
                noteTransform.localScale = new Vector3(1f, 1f, 1f);
            }
            //      Log("DESPAWN" + noteTransform.localScale.ToString());
            //        if (modifiedNotes[note.id] != null)
            //           note = modifiedNotes[note.id];
            FloatBehavior behavior = noteTransform?.gameObject.GetComponent <FloatBehavior>();

            if (behavior != null)
            {
                noteTransform.localPosition = new Vector3(behavior.originalX, behavior.originalY, noteTransform.localPosition.z);
                GameObject.Destroy(behavior);
            }
        }
Пример #4
0
        private void SpawnController_ScaleRemoveCut(BeatmapObjectSpawnController arg1, INoteController controller, NoteCutInfo arg3)
        {
            NoteData  note          = controller.noteData;
            Transform noteTransform = controller.noteTransform;

            //      Log("DESPAWN" + noteTransform.localScale.ToString());
            if (noteTransform.localScale.x != 1)
            {
                noteTransform.localScale = new Vector3(1f, 1f, 1f);
            }
            //          Log("DESPAWN" + noteTransform.localScale.ToString());



            //     if (modifiedNotes[note.id] != null)
            //          note = modifiedNotes[note.id];

            FloatBehavior behavior = noteTransform.gameObject.GetComponent <FloatBehavior>();

            if (behavior != null)
            {
                noteTransform.localPosition = new Vector3(behavior.originalX, behavior.originalY, noteTransform.localPosition.z);
                GameObject.Destroy(behavior);
            }


            if (GMPUI.oneColor)
            {
                if (!defaultRumble)
                {
                    return;
                }
                _noteCutEffectSpawner = UnityEngine.Object.FindObjectOfType <NoteCutEffectSpawner>();
                if (_noteCutEffectSpawner != null)
                {
                    _noteCutHapticEffect = ReflectionUtil.GetPrivateField <NoteCutHapticEffect>(_noteCutEffectSpawner, "_noteCutHapticEffect");
                }
                if (_noteCutHapticEffect != null)
                {
                    _hapticFeedbackController = ReflectionUtil.GetPrivateField <HapticFeedbackController>(_noteCutHapticEffect, "_hapticFeedbackController");
                }
                if (_hapticFeedbackController != null)
                {
                    _RumbleEnabledOneC = ReflectionUtil.GetPrivateField <BoolSO>(_hapticFeedbackController, "_controllersRumbleEnabled");
                }

                if (_RumbleEnabledOneC == null)
                {
                    return;
                }
                Vector3 notePos = controller.noteTransform.position;

                Vector3 leftPos = player.leftSaber.transform.position;
                leftPos += player.leftSaber.transform.forward * 0.5f;
                Vector3 rightPos = player.rightSaber.transform.position;
                rightPos += player.rightSaber.transform.forward * 0.5f;

                float leftDist  = Vector3.Distance(leftPos, notePos);
                float rightDist = Vector3.Distance(rightPos, notePos);
                // Log(leftDist.ToString() + "   " + rightDist.ToString());
                _RumbleEnabledOneC.value = true;
                Saber.SaberType targetType = (leftDist > rightDist) ? Saber.SaberType.SaberB : Saber.SaberType.SaberA;
                if (!(Mathf.Abs(leftDist - rightDist) <= 0.2f))
                {
                    _noteCutHapticEffect.HitNote(targetType);
                }
                else
                {
                    _noteCutHapticEffect.HitNote(Saber.SaberType.SaberA);
                    _noteCutHapticEffect.HitNote(Saber.SaberType.SaberB);
                }
                _RumbleEnabledOneC.value = false;
            }
        }