skybox subsetter
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
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;
|
||||
|
||||
Camera gameCamera => EditorManager.instance.cameraManager.gameCamera.gameCamera;
|
||||
|
||||
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(EditorManager.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 Beatmap.CameraZoomEffect_BM(duration, relativeZoom, zoomCurve);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Camera Shake");
|
||||
var effectSettings = container.GenerateSubcontainer(3);
|
||||
var zoomDurationInputField = inspector.GenerateInputField(this, effectSettings, "Zoom Duration", nameof(duration));
|
||||
var relativeZoomInputField = inspector.GenerateInputField(this, effectSettings, "Relative Zoom", nameof(relativeZoom));
|
||||
var zoomCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
|
||||
{
|
||||
var zoomCurveWindow =
|
||||
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(zoomCurve)).SetAsCustomCurve();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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: f032e18bed2fda546a37183f170e6e49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user