2025-07-10 08:42:30 -04:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using Ichni.RhythmGame.Beatmap;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Ichni.RhythmGame
|
|
|
|
|
{
|
|
|
|
|
public class CameraTiltEffect : EffectBase
|
|
|
|
|
{
|
|
|
|
|
public float duration;
|
|
|
|
|
public Vector3 tiltValue;
|
|
|
|
|
public AnimationCurve tiltCurve;
|
|
|
|
|
|
2025-09-05 10:14:45 -04:00
|
|
|
GameCamera gameCamera=> GameManager.instance.cameraManager.gameCamera;
|
2025-07-10 08:42:30 -04:00
|
|
|
Tweener tiltTweener;
|
2025-09-05 10:14:45 -04:00
|
|
|
Tweener tiltBackTweener;
|
2025-07-10 08:42:30 -04:00
|
|
|
|
|
|
|
|
public CameraTiltEffect(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
|
|
|
|
|
{
|
|
|
|
|
this.effectTime = duration;
|
|
|
|
|
this.duration = duration;
|
|
|
|
|
this.tiltValue = tiltValue;
|
|
|
|
|
this.tiltCurve = tiltCurve;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Recover()
|
|
|
|
|
{
|
|
|
|
|
tiltTweener?.Kill(true);
|
2025-09-05 10:14:45 -04:00
|
|
|
tiltBackTweener?.Kill(true);
|
|
|
|
|
gameCamera.cam.transform.localEulerAngles = Vector3.zero;
|
2025-07-10 08:42:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PreExecute()
|
|
|
|
|
{
|
2025-09-05 10:14:45 -04:00
|
|
|
tiltTweener = gameCamera.cam.transform.DOBlendableLocalRotateBy(tiltValue, duration, RotateMode.FastBeyond360).SetEase(tiltCurve).Play();
|
2025-07-10 08:42:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Adjust()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
|
|
|
{
|
|
|
|
|
return new CameraTiltEffect_BM(duration, tiltValue, tiltCurve);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Disrupt()
|
|
|
|
|
{
|
|
|
|
|
tiltTweener?.Kill();
|
2025-09-05 10:14:45 -04:00
|
|
|
tiltBackTweener = gameCamera.cam.transform.DOLocalRotate(Vector3.zero, 0.4f).SetEase(Ease.OutSine).Play();
|
2025-07-10 08:42:30 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Beatmap
|
|
|
|
|
{
|
|
|
|
|
public class CameraTiltEffect_BM : EffectBase_BM
|
|
|
|
|
{
|
|
|
|
|
public float duration;
|
|
|
|
|
public Vector3 tiltValue;
|
|
|
|
|
public AnimationCurve tiltCurve;
|
|
|
|
|
|
|
|
|
|
public CameraTiltEffect_BM(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
|
|
|
|
|
{
|
|
|
|
|
this.effectTime = duration;
|
|
|
|
|
this.duration = duration;
|
|
|
|
|
this.tiltValue = tiltValue;
|
|
|
|
|
this.tiltCurve = tiltCurve;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
|
|
|
{
|
|
|
|
|
return new CameraTiltEffect(duration, tiltValue, tiltCurve);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|