Hold Tilt
This commit is contained in:
@@ -79,23 +79,6 @@ namespace Ichni.RhythmGame
|
||||
var extensionButton = inspector.GenerateButton(this, generateAnimation, "Extension",
|
||||
() => GameCameraExtension.GenerateElement("New Extension", Guid.NewGuid(),
|
||||
new List<string>(), true, this, 1000f));
|
||||
if (childElementList.Where(i => i is CameraAngleOffset).Count() == 0)
|
||||
{
|
||||
var CAOButton = inspector.GenerateButton(this, generateAnimation, "CameraAngleOffset",
|
||||
() => CameraAngleOffset.GenerateElement(
|
||||
"New CameraAngleOffset",
|
||||
Guid.NewGuid(),
|
||||
new List<string>(),
|
||||
true,
|
||||
this,
|
||||
new FlexibleBool(),
|
||||
0f,
|
||||
0f,
|
||||
0f,
|
||||
0f,
|
||||
AnimationCurveType.Linear
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffad603e762bde64ab5f9e4688f3fde1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -7,6 +7,7 @@ using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
@@ -135,6 +136,15 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
protected override void Update()
|
||||
{
|
||||
if (Keyboard.current.hKey.wasPressedThisFrame)
|
||||
{
|
||||
foreach (KeyValuePair<string,List<EffectBase>> effect in noteVisual.effectSubmodule.effectCollection)
|
||||
{
|
||||
effect.Value.ForEach(x => x.Disrupt());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (holdEndTime < exactJudgeTime)
|
||||
{
|
||||
LogWindow.Log("Hold end time is earlier than exact judge time.", Color.red);
|
||||
@@ -193,9 +203,11 @@ namespace Ichni.RhythmGame
|
||||
if (noteVisual != null)
|
||||
{
|
||||
noteVisual.effectSubmodule.effectCollection["Generate"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
noteVisual.effectSubmodule.effectCollection["StartHold"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Holding"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
|
||||
|
||||
noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
switch (EditorManager.instance.currentJudgeType)
|
||||
{
|
||||
case NoteJudgeType.Perfect:
|
||||
@@ -211,6 +223,8 @@ namespace Ichni.RhythmGame
|
||||
noteVisual.effectSubmodule.effectCollection["Miss"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
break;
|
||||
}
|
||||
|
||||
noteVisual.effectSubmodule.effectCollection["AfterJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
|
||||
if (EditorManager.instance.cameraManager.haveGameCamera)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user