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;
|
|
|
|
|
|
|
|
|
|
Transform gameCameraTransform => GameManager.instance.cameraManager.gameCamera.gameCamera.transform;
|
|
|
|
|
Tweener tiltTweener;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
gameCameraTransform.localEulerAngles = Vector3.zero;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PreExecute()
|
|
|
|
|
{
|
2025-08-22 14:54:40 -04:00
|
|
|
tiltTweener = gameCameraTransform.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-08-22 14:54:40 -04:00
|
|
|
gameCameraTransform.DOLocalRotate(Vector3.zero, 0.4f).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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|