Пример #1
0
        public static bool Prefix(MissedNoteEffectSpawner __instance, BeatmapObjectSpawnController noteSpawnController, NoteController noteController, ref FlyingSpriteSpawner ____missedNoteFlyingSpriteSpawner, ref float ____spawnPosZ)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            NoteData noteData = noteController.noteData;

            if (noteData.noteType == NoteType.NoteA || noteData.noteType == NoteType.NoteB)
            {
                FlyingSpriteSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
                FlyingSpriteSpawnerPatch.lastNoteRotationSet = true;
                Vector3 pos = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * noteController.noteTransform.position;
                pos.z = ____spawnPosZ;
                ____missedNoteFlyingSpriteSpawner.SpawnFlyingSprite(pos);
            }
            return(false);
        }
Пример #2
0
        public static bool Prefix(MissedNoteEffectSpawner __instance, Vector3 pos, NoteController noteController, NoteCutInfo noteCutInfo, ref BombExplosionEffect ____bombExplosionEffect, ref FlyingSpriteSpawner ____failFlyingSpriteSpawner, ref ShockwaveEffect ____shockwaveEffect)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            FlyingSpriteSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
            FlyingSpriteSpawnerPatch.lastNoteRotationSet = true;
            Vector3 pos2 = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * pos;

            ____failFlyingSpriteSpawner.SpawnFlyingSprite(pos2);
            ____bombExplosionEffect.SpawnExplosion(pos);
            Vector3 pos3 = pos;

            pos3.y = 0.01f;
            ____shockwaveEffect.SpawnShockwave(pos3);

            return(false);
        }
        public static void Prefix(MissedNoteEffectSpawner ____missedNoteEffectSpawnerPrefab)
        {
            GameObject gameObject = ____missedNoteEffectSpawnerPrefab.gameObject;

            // we can't destroy original MissedNoteEffectSpawner since it kills the reference given through [SerializeField]
            gameObject.GetComponent <MissedNoteEffectSpawner>().enabled = false;
            gameObject.transform.Find("MissedNoteFlyingSpriteSpawner").gameObject.SetActive(false);

            var textSpawner   = gameObject.GetComponent <ItalicizedFlyingTextSpawner>();
            var effectSpawner = gameObject.GetComponent <TextBasedMissedNoteEffectSpawner>();

            if (!textSpawner)
            {
                gameObject.AddComponent <ItalicizedFlyingTextSpawner>();
            }

            if (!effectSpawner)
            {
                gameObject.AddComponent <TextBasedMissedNoteEffectSpawner>();
            }
        }