Hold Tilt

This commit is contained in:
SoulliesOfficial
2025-06-01 07:41:55 -04:00
parent df7abdb320
commit 61e6ac3a32
13 changed files with 16677 additions and 16674 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
@@ -26,6 +27,8 @@ namespace Ichni.RhythmGame
public float zPeak;
public AnimationCurve tiltCurveZ;
public List<MMF_Player> avtiveEffectExecutors;
public CameraTiltEffect(bool haveXTilt, float xDuration, float xPeak, AnimationCurve tiltCurveX,
bool haveYTilt, float yDuration, float yPeak, AnimationCurve tiltCurveY,
bool haveZTilt, float zDuration, float zPeak, AnimationCurve tiltCurveZ)
@@ -46,6 +49,8 @@ namespace Ichni.RhythmGame
this.zDuration = zDuration;
this.zPeak = zPeak;
this.tiltCurveZ = tiltCurveZ;
avtiveEffectExecutors = new List<MMF_Player>();
}
public override void Adjust()
@@ -66,6 +71,8 @@ namespace Ichni.RhythmGame
effect.GetFeedbackOfType<MMF_Rotation>().AnimateZ = false;
effect.GetFeedbackOfType<MMF_Rotation>().RemapCurveOne = xPeak;
effect.GetFeedbackOfType<MMF_Rotation>().AnimateRotationX = tiltCurveX;
effect.GetComponent<PooledObject>().SetOnDespawn(() => avtiveEffectExecutors.Remove(effect));
avtiveEffectExecutors.Add(effect);
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, xDuration);
}
@@ -80,6 +87,8 @@ namespace Ichni.RhythmGame
effect.GetFeedbackOfType<MMF_Rotation>().AnimateZ = false;
effect.GetFeedbackOfType<MMF_Rotation>().RemapCurveOne = yPeak;
effect.GetFeedbackOfType<MMF_Rotation>().AnimateRotationY = tiltCurveY;
effect.GetComponent<PooledObject>().SetOnDespawn(() => avtiveEffectExecutors.Remove(effect));
avtiveEffectExecutors.Add(effect);
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, yDuration);
}
@@ -94,6 +103,8 @@ namespace Ichni.RhythmGame
effect.GetFeedbackOfType<MMF_Rotation>().AnimateY = false;
effect.GetFeedbackOfType<MMF_Rotation>().RemapCurveOne = zPeak;
effect.GetFeedbackOfType<MMF_Rotation>().AnimateRotationZ = tiltCurveZ;
effect.GetComponent<PooledObject>().SetOnDespawn(() => avtiveEffectExecutors.Remove(effect));
avtiveEffectExecutors.Add(effect);
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, zDuration);
}
@@ -106,7 +117,22 @@ namespace Ichni.RhythmGame
haveYTilt, yDuration, yPeak, tiltCurveY,
haveZTilt, zDuration, zPeak, tiltCurveZ);
}
public override void Disrupt()
{
foreach (MMF_Player executor in avtiveEffectExecutors)
{
executor.StopFeedbacks();
}
for (var i = 0; i < avtiveEffectExecutors.Count; i++)
{
LeanPool.Despawn(avtiveEffectExecutors[i].gameObject);
}
EditorManager.instance.cameraManager.gameCamera.gameCamera.transform.DOLocalRotate(Vector3.zero, 0.2f);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class CameraTiltHoldingEffect : MonoBehaviour
{
public bool haveXTilt;
public float xDuration;
public float xPeak;
public AnimationCurve tiltCurveX;
public bool haveYTilt;
public float yDuration;
public float yPeak;
public AnimationCurve tiltCurveY;
public bool haveZTilt;
public float zDuration;
public float zPeak;
public AnimationCurve tiltCurveZ;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ffad603e762bde64ab5f9e4688f3fde1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: