update
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class CameraOffsetEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public Vector3 offsetValue;
|
||||
public AnimationCurve offsetCurve;
|
||||
|
||||
Transform gameCameraTransform => GameManager.instance.cameraManager.gameCamera.gameCamera.transform;
|
||||
Tweener offsetTweener;
|
||||
|
||||
public CameraOffsetEffect(float duration, Vector3 offsetValue, AnimationCurve offsetCurve)
|
||||
{
|
||||
this.effectTime = this.duration;
|
||||
this.duration = duration;
|
||||
this.offsetValue = offsetValue;
|
||||
this.offsetCurve = offsetCurve;
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
offsetTweener?.Kill(true);
|
||||
gameCameraTransform.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
offsetTweener = gameCameraTransform.DOBlendableLocalMoveBy(offsetValue, duration).SetEase(offsetCurve);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new CameraOffsetEffect_BM(duration, offsetValue, offsetCurve);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class CameraOffsetEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public Vector3 offsetValue;
|
||||
public AnimationCurve offsetCurve;
|
||||
|
||||
public CameraOffsetEffect_BM(float duration, Vector3 offsetValue, AnimationCurve offsetCurve)
|
||||
{
|
||||
this.effectTime = duration;
|
||||
this.duration = duration;
|
||||
this.offsetValue = offsetValue;
|
||||
this.offsetCurve = offsetCurve;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new CameraOffsetEffect(duration, offsetValue, offsetCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b082ee12ba2393b48b5f6bce4cf23e23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
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()
|
||||
{
|
||||
tiltTweener = gameCameraTransform.DOBlendableLocalRotateBy(tiltValue, duration, RotateMode.FastBeyond360).SetEase(tiltCurve);
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new CameraTiltEffect_BM(duration, tiltValue, tiltCurve);
|
||||
}
|
||||
|
||||
public override void Disrupt()
|
||||
{
|
||||
tiltTweener?.Kill();
|
||||
gameCameraTransform.DOLocalRotate(Vector3.zero, 0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 764e22166d03b564bb12196d028a7640
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,64 @@
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using MoreMountains.Feedbacks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class CameraZoomEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public float relativeZoom;
|
||||
public AnimationCurve zoomCurve;
|
||||
|
||||
public CameraZoomEffect(float duration, float relativeZoom, AnimationCurve zoomCurve)
|
||||
{
|
||||
this.effectTime = 0f;
|
||||
this.duration = duration;
|
||||
this.relativeZoom = relativeZoom;
|
||||
this.zoomCurve = zoomCurve;
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
MMF_Player effect = LeanPool.Spawn(GameManager.instance.basePrefabs.cameraZoomEffect).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_CameraFieldOfView>().Duration = duration;
|
||||
effect.GetFeedbackOfType<MMF_CameraFieldOfView>().RemapFieldOfViewOne = relativeZoom;
|
||||
effect.GetFeedbackOfType<MMF_CameraFieldOfView>().ShakeFieldOfView = zoomCurve;
|
||||
effect.PlayFeedbacks();
|
||||
LeanPool.Despawn(effect.gameObject, duration);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new CameraZoomEffect_BM(duration, relativeZoom, zoomCurve);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class CameraZoomEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public float relativeZoom;
|
||||
public AnimationCurve zoomCurve;
|
||||
|
||||
public CameraZoomEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CameraZoomEffect_BM(float duration, float relativeZoom, AnimationCurve zoomCurve)
|
||||
{
|
||||
this.duration = duration;
|
||||
this.relativeZoom = relativeZoom;
|
||||
this.zoomCurve = zoomCurve;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new CameraZoomEffect(duration, relativeZoom, zoomCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d739305a671fa543ab8b5e1d608edc6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,90 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class PixelateEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public float bottomX;
|
||||
public float bottomY;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
public PixelateEffect(float duration, float bottomX, float bottomY, AnimationCurve intensityCurve)
|
||||
{
|
||||
this.effectTime = duration;
|
||||
this.duration = duration;
|
||||
this.bottomX = bottomX;
|
||||
this.bottomY = bottomY;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
GameManager.instance.postProcessingManager.SetPixelateStrength(Screen.width, Screen.height);
|
||||
GameManager.instance.postProcessingManager.SetFeatureActive(false);
|
||||
}
|
||||
|
||||
public override void Disrupt()
|
||||
{
|
||||
GameManager.instance.postProcessingManager.SetPixelateStrength(Screen.width, Screen.height);
|
||||
GameManager.instance.postProcessingManager.SetFeatureActive(false);
|
||||
}
|
||||
|
||||
public override void PreExecute()
|
||||
{
|
||||
GameManager.instance.postProcessingManager.SetFeatureActive(true);
|
||||
GameManager.instance.postProcessingManager.SetPixelateStrength(Screen.width, Screen.height);
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
float x = Mathf.Lerp(Screen.width, bottomX, intensityCurve.Evaluate(effectProgressPercent));
|
||||
float y = Mathf.Lerp(Screen.height, bottomY, intensityCurve.Evaluate(effectProgressPercent));
|
||||
Debug.Log(x + ", " + y);
|
||||
|
||||
GameManager.instance.postProcessingManager.SetPixelateStrength(x,y);
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
GameManager.instance.postProcessingManager.SetPixelateStrength(Screen.width, Screen.height);
|
||||
GameManager.instance.postProcessingManager.SetFeatureActive(false);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new PixelateEffect_BM(duration, bottomX, bottomY, intensityCurve);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class PixelateEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public float bottomX;
|
||||
public float bottomY;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
public PixelateEffect_BM(float duration, float bottomX, float bottomY, AnimationCurve intensityCurve)
|
||||
{
|
||||
this.effectTime = duration;
|
||||
this.duration = duration;
|
||||
this.bottomX = bottomX;
|
||||
this.bottomY = bottomY;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new PixelateEffect(duration, bottomX, bottomY, intensityCurve)
|
||||
{
|
||||
attachedGameElement = attachedGameElement
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b8ffa1f96c4b9943ba150ea99ae9005
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -7,8 +7,9 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class TimeEffectsCollection : GameElement, IHaveEffectSubmodule
|
||||
public partial class TimeEffectsCollection : GameElement, IHaveTransformSubmodule, IHaveEffectSubmodule
|
||||
{
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
public EffectSubmodule effectSubmodule { get; set; }
|
||||
public float time; //触发效果的时间
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
effectSubmodule = new EffectSubmodule(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user