public static bool Prefix(FlyingScoreSpawner __instance, NoteCutInfo noteCutInfo, int noteLineIndex, int multiplier, Vector3 pos, Color color, ref float[,] ___lineSlotSpawnTimes, ref FlyingScoreEffect.Pool ____flyingScoreEffectPool) { if (!Plugin.active) { return(true); } if (noteLineIndex >= ___lineSlotSpawnTimes.GetLength(0)) { float[,] array = new float[noteLineIndex, 1]; for (int i = 0; i < ___lineSlotSpawnTimes.GetLength(0); i++) { for (int j = 0; j < 1; j++) { array[i, j] = ___lineSlotSpawnTimes[i, j]; } } ___lineSlotSpawnTimes = array; } int num = 0; while (num < 0 && ___lineSlotSpawnTimes[noteLineIndex, num] + 0.4f >= Time.timeSinceLevelLoad) { num++; } ___lineSlotSpawnTimes[noteLineIndex, num] = Time.timeSinceLevelLoad; FlyingScoreEffect flyingScoreEffect = ____flyingScoreEffectPool.Spawn(); flyingScoreEffect.didFinishEvent += __instance.HandleFlyingScoreEffectDidFinish; Vector3 targetPos = Vector3.zero; if (lastNoteRotationSet) { flyingScoreEffect.transform.SetPositionAndRotation(lastNoteRotation * pos, lastNoteRotation); pos.z = 0f; pos.y = -0.24f; targetPos = lastNoteRotation * (pos + new Vector3(0f, -0.23f * num, 7.55f)); } else { flyingScoreEffect.transform.SetPositionAndRotation(pos, Quaternion.identity); pos.z = 0f; pos.y = -0.24f; targetPos = pos + new Vector3(0f, -0.23f * num, 7.55f); } flyingScoreEffect.InitAndPresent(noteCutInfo, multiplier, 0.7f, targetPos, color); return(false); }
private static bool Prefix(FlyingScoreSpawner __instance, FlyingScoreEffect.Pool ____flyingScoreEffectPool, Vector3 pos, NoteCutInfo noteCutInfo, Quaternion rotation, Quaternion inverseRotation) { IEnumerator g__SpawnFlyingScoreEffectCoroutine(int index, Vector3 position) { yield return(new WaitForSecondsRealtime(FlyingObjectEffectParameters.timeShift * index)); FlyingScoreEffect flyingScoreEffect = ____flyingScoreEffectPool.Spawn(); flyingScoreEffect.didFinishEvent += __instance.HandleFlyingScoreEffectDidFinish; flyingScoreEffect.transform.localPosition = position; position = inverseRotation * position; position.z = 0f; if (PluginConfig.Instance.forward) { float offsetY = (PluginConfig.Instance.scale - 0.5f) * FlyingObjectEffectParameters.scaleOffsetCoefY; position = new Vector3(position.x, PluginConfig.Instance.forwardTargetY + offsetY, pos.z + PluginConfig.Instance.forwardTargetZ); position = rotation * position; } flyingScoreEffect.InitAndPresent(noteCutInfo, index * -1, -0.7f, position, rotation, Color.white); } bool noScoreText = PluginConfig.Instance.noScoreText; bool result; if (noScoreText) { result = false; } else { bool flag = !PluginConfig.Instance.pro; if (flag) { float offsetX = FlyingObjectEffectParameters.scoreNumberOffsetX * PluginConfig.Instance.scale; bool forward = PluginConfig.Instance.forward; if (forward) { offsetX *= FlyingObjectEffectParameters.forwardScale; } Vector3 offset = new Vector3(offsetX, 0f, 0f); Vector3 pos2 = rotation * (Quaternion.Inverse(rotation) * pos - offset); Vector3 pos3 = rotation * (Quaternion.Inverse(rotation) * pos + offset); PersistentSingleton <SharedCoroutineStarter> .instance.StartCoroutine(g__SpawnFlyingScoreEffectCoroutine(1, pos2)); PersistentSingleton <SharedCoroutineStarter> .instance.StartCoroutine(g__SpawnFlyingScoreEffectCoroutine(2, pos)); PersistentSingleton <SharedCoroutineStarter> .instance.StartCoroutine(g__SpawnFlyingScoreEffectCoroutine(3, pos3)); } result = true; } return(result); }