add icon, remove colorease

adding colorease in a different pr
This commit is contained in:
AstrlJelly 2024-02-28 22:48:54 -05:00
parent 1cdaf300fb
commit 8f295cd555
17 changed files with 317 additions and 115 deletions

View file

@ -1264,6 +1264,11 @@ MonoBehaviour:
alarmAnim: {fileID: 3637100343128600021} alarmAnim: {fileID: 3637100343128600021}
dingAnim: {fileID: 7386547292618809648} dingAnim: {fileID: 7386547292618809648}
cannerAnim: {fileID: 7509521705116870356} cannerAnim: {fileID: 7509521705116870356}
aStartBeat: 0
aLength: 0
aStartColor: {r: 0, g: 0, b: 0, a: 0}
aEndColor: {r: 0, g: 0, b: 0, a: 0}
aEase: 0
--- !u!1 &5862740553224149703 --- !u!1 &5862740553224149703
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: f5fbcd0de07ecb7429a3bb75da47ea60 guid: 84ae0c5188393c54f8d34a331631e549
AudioImporter: AudioImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 6 serializedVersion: 6

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

View file

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 5b787766f3f00a046a24d5ccbbd9133d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 8
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 4289aad5e58f9d548892576c6db75165
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 8
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -84,7 +84,7 @@ Material:
m_Colors: m_Colors:
- _AddColor: {r: 0, g: 0, b: 0, a: 0} - _AddColor: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1}
- _ColorAlpha: {r: 0.862, g: 0.372, b: 0.031, a: 1} - _ColorAlpha: {r: 0.8627, g: 0.3725, b: 0.0313, a: 1}
- _ColorBravo: {r: 0.49803922, g: 0.49803922, b: 0.5058824, a: 1} - _ColorBravo: {r: 0.49803922, g: 0.49803922, b: 0.5058824, a: 1}
- _ColorDelta: {r: 0.24705882, g: 0.24313726, b: 0.24705882, a: 1} - _ColorDelta: {r: 0.24705882, g: 0.24313726, b: 0.24705882, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View file

@ -40,10 +40,10 @@ AnimatorStateMachine:
m_Position: {x: 280, y: 110, z: 0} m_Position: {x: 280, y: 110, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 671542589843244340} m_State: {fileID: 671542589843244340}
m_Position: {x: 280, y: 180, z: 0} m_Position: {x: 280, y: 170, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 808679152055322211} m_State: {fileID: 808679152055322211}
m_Position: {x: 280, y: 240, z: 0} m_Position: {x: 280, y: 230, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
@ -203,13 +203,13 @@ AnimatorStateMachine:
m_ChildStates: m_ChildStates:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -7318305927348823551} m_State: {fileID: -7318305927348823551}
m_Position: {x: 280, y: 180, z: 0} m_Position: {x: 280, y: 170, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -3105581592757715715} m_State: {fileID: -3105581592757715715}
m_Position: {x: 280, y: 110, z: 0} m_Position: {x: 280, y: 110, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 7320030847503406928} m_State: {fileID: 7320030847503406928}
m_Position: {x: 280, y: 240, z: 0} m_Position: {x: 280, y: 230, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []

View file

@ -219,7 +219,7 @@ AnimationClip:
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
m_HasAdditiveReferencePose: 0 m_HasAdditiveReferencePose: 0
m_LoopTime: 1 m_LoopTime: 0
m_LoopBlend: 0 m_LoopBlend: 0
m_LoopBlendOrientation: 0 m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0 m_LoopBlendPositionY: 0

View file

@ -33,7 +33,7 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: CannerCanBarely m_Name: CanBarely
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions: []
@ -146,7 +146,7 @@ AnimatorStateMachine:
m_Position: {x: 279.17062, y: 256.5166, z: 0} m_Position: {x: 279.17062, y: 256.5166, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -4925777547588300938} m_State: {fileID: -4925777547588300938}
m_Position: {x: 314.17062, y: 321.5166, z: 0} m_Position: {x: 280, y: 330, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []

View file

@ -604,7 +604,7 @@ AnimationClip:
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
m_HasAdditiveReferencePose: 0 m_HasAdditiveReferencePose: 0
m_LoopTime: 1 m_LoopTime: 0
m_LoopBlend: 0 m_LoopBlend: 0
m_LoopBlendOrientation: 0 m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0 m_LoopBlendPositionY: 0

View file

@ -20,17 +20,17 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: -9.62, y: -4.782, z: 0} value: {x: -10.583, y: -4.782, z: 0}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 115.439995, y: 0, z: 0} outSlope: {x: 132.498, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.16666667 time: 0.16666667
value: {x: 9.62, y: -4.782, z: 0} value: {x: 11.5, y: -4.782, z: 0}
inSlope: {x: 115.439995, y: 0, z: 0} inSlope: {x: 132.498, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
weightedMode: 0 weightedMode: 0
@ -84,17 +84,17 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: -9.62 value: -10.583
inSlope: 0 inSlope: 0
outSlope: 115.439995 outSlope: 132.498
tangentMode: 69 tangentMode: 69
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.16666667 time: 0.16666667
value: 9.62 value: 11.5
inSlope: 115.439995 inSlope: 132.498
outSlope: 0 outSlope: 0
tangentMode: 69 tangentMode: 69
weightedMode: 0 weightedMode: 0

View file

@ -1,7 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using NaughtyBezierCurves;
using HeavenStudio.Util; using HeavenStudio.Util;
@ -32,15 +31,17 @@ namespace HeavenStudio.Games.Scripts_Cannery
private void Hit(PlayerActionEvent caller, float state) private void Hit(PlayerActionEvent caller, float state)
{ {
game.cannerAnim.DoScaledAnimationAsync("Can", 0.5f);
SoundByte.PlayOneShotGame("cannery/can"); SoundByte.PlayOneShotGame("cannery/can");
anim.DoScaledAnimationAsync("Can", 0.5f, 0, 1); anim.DoScaledAnimationAsync("Can", 0.5f, 0, 1);
if (state is >= 1 or <= (-1)) { if (state is >= 1 or <= -1) {
SoundByte.PlayOneShot("nearMiss"); SoundByte.PlayOneShot("nearMiss");
game.cannerAnim.DoScaledAnimationAsync("CanBarely", 0.5f);
double beat = caller.startBeat + caller.timer; double beat = caller.startBeat + caller.timer;
BeatAction.New(this, new() { BeatAction.New(this, new() {
new(beat + 0.35f, () => anim.DoScaledAnimationAsync("Reopen", 0.5f, 0, 1)) new(beat + 0.35f, () => anim.DoScaledAnimationAsync("Reopen", 0.5f, 0, 1))
}); });
} else {
game.cannerAnim.DoScaledAnimationAsync("Can", 0.5f);
} }
} }
} }

View file

@ -1,9 +1,11 @@
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Games.Loaders namespace HeavenStudio.Games.Loaders
{ {
using static Minigames; using static Minigames;
@ -29,7 +31,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("can", "Can") new GameAction("can", "Can")
{ {
preFunction = delegate { preFunction = delegate {
Cannery.CanSFX(eventCaller.currentEntity.beat); SoundByte.PlayOneShotGame("cannery/ding", eventCaller.currentEntity.beat, forcePlay: true);
if (eventCaller.gameManager.minigameObj.TryGetComponent(out Cannery instance)) { if (eventCaller.gameManager.minigameObj.TryGetComponent(out Cannery instance)) {
instance.SendCan(eventCaller.currentEntity.beat); instance.SendCan(eventCaller.currentEntity.beat);
} }
@ -45,23 +47,6 @@ namespace HeavenStudio.Games.Loaders
}, },
defaultLength = 0.5f, defaultLength = 0.5f,
}, },
new GameAction("backgroundColor", "Background Color")
{
function = delegate {
var e = eventCaller.currentEntity;
if (eventCaller.gameManager.minigameObj.TryGetComponent(out Cannery instance)) {
instance.BackgroundColorChange(e.beat, e.length, e["startColor"], e["endColor"], e["ease"]);
}
},
defaultLength = 1f,
resizable = true,
parameters = new List<Param>()
{
new Param("startColor", new Color(1, 1, 1), "Start Color", "Set the color at the start of the event."),
new Param("endColor", new Color(1, 1, 1), "End Color", "Set the color at the end of the event."),
new Param("ease", Util.EasingFunction.Ease.Instant, "Ease", "Set the easing of the action."),
},
},
new GameAction("alarmColor", "Alarm Color") new GameAction("alarmColor", "Alarm Color")
{ {
function = delegate { function = delegate {
@ -73,8 +58,8 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 0.5f, defaultLength = 0.5f,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("startColor", new Color(0.8627f, 0.3725f, 0.0313f), "Start Color", "Set the color at the start of the event.", new() { new((_, _) => true, new string[] { "startColor" }) }), new Param("startColor", Cannery.alarmColor , "Start Color", "Set the color at the start of the event.", new() { new((_, _) => true, new string[] { "startColor" }) }),
new Param("endColor", new Color(0.8627f, 0.3725f, 0.0313f), "End Color", "Set the color at the end of the event."), new Param("endColor", Cannery.alarmColor, "End Color", "Set the color at the end of the event."),
new Param("ease", Util.EasingFunction.Ease.Instant, "Ease", "Set the easing of the action."), new Param("ease", Util.EasingFunction.Ease.Instant, "Ease", "Set the easing of the action."),
} }
}, },
@ -106,29 +91,47 @@ namespace HeavenStudio.Games
public Animator dingAnim; public Animator dingAnim;
public Animator cannerAnim; public Animator cannerAnim;
private ColorEase bgColorEase = new(Color.white); // private ColorEase bgColorEase = new(Color.white);
private ColorEase alarmColorEase = new(new Color(0.862f, 0.372f, 0.031f)); public static readonly Color alarmColor = new Color(0.8627f, 0.3725f, 0.0313f);
public double aStartBeat;
public float aLength;
public Color aStartColor, aEndColor;
public Util.EasingFunction.Ease aEase = Util.EasingFunction.Ease.Instant;
public Util.EasingFunction.Function aEaseFunc;
private bool alarmBop = true; private bool alarmBop = true;
// public static Cannery instance;
private void Awake() private void Awake()
{ {
// instance = this;
can.gameObject.SetActive(false); can.gameObject.SetActive(false);
// bgColorEase = new(Color.white); aStartColor = aEndColor = alarmColor;
// alarmColorEase = new(new Color(0.86f, 0.37f, 0.03f));
} }
private void Update() private void Update()
{ {
conveyorBeltAnim.DoNormalizedAnimation("Move", (Conductor.instance.songPositionInBeats / 2) % 1); if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) {
cannerAnim.DoScaledAnimationAsync("CanEmpty", 0.5f);
SoundByte.PlayOneShotGame("cannery/can");
SoundByte.PlayOneShot("nearMiss");
}
conveyorBeltAnim.DoNormalizedAnimation("Move", (conductor.songPositionInBeats / 2) % 1);
bgPlaneSR.color = GetNewColor(bgColorEase); float normalizedBeat = Mathf.Clamp01(Conductor.instance.GetPositionFromBeat(conductor.songPositionInBeatsAsDouble, aLength));
alarmMat.SetColor("_ColorAlpha", GetNewColor(alarmColorEase));
Color newColor = alarmColor;
if (!double.IsNaN(normalizedBeat)) {
aEaseFunc ??= Util.EasingFunction.GetEasingFunction(aEase);
float newR = aEaseFunc(aStartColor.r, aEndColor.r, normalizedBeat);
float newG = aEaseFunc(aStartColor.g, aEndColor.g, normalizedBeat);
float newB = aEaseFunc(aStartColor.b, aEndColor.b, normalizedBeat);
newColor = new Color(newR, newG, newB);
}
alarmMat.SetColor("_ColorAlpha", newColor);
} }
public override void OnPlay(double beat) => OnGameSwitch(beat);
public override void OnStop(double beat) => OnGameSwitch(beat);
public override void OnGameSwitch(double beat) public override void OnGameSwitch(double beat)
{ {
List<RiqEntity> events = GameManager.instance.Beatmap.Entities.FindAll(e => e.datamodel.Split('/')[0] == "cannery"); List<RiqEntity> events = GameManager.instance.Beatmap.Entities.FindAll(e => e.datamodel.Split('/')[0] == "cannery");
@ -136,27 +139,16 @@ namespace HeavenStudio.Games
foreach (var can in cans) { foreach (var can in cans) {
SendCan(can.beat); SendCan(can.beat);
} }
RiqEntity bgEvent = events.FindLast(e => e.datamodel == "cannery/backgroundColor" && e.beat < beat);
if (bgEvent != null) {
var e = bgEvent;
BackgroundColorChange(e.beat, e.length, e["startColor"], e["endColor"], e["ease"]);
} else {
BackgroundColorChange(0, 0, new Color(0.8627f, 0.3725f, 0.0313f), new Color(0.8627f, 0.3725f, 0.0313f), 0);
}
RiqEntity alarmEvent = events.FindLast(e => e.datamodel == "cannery/alarmColor" && e.beat < beat); RiqEntity alarmEvent = events.FindLast(e => e.datamodel == "cannery/alarmColor" && e.beat < beat);
if (alarmEvent != null) { if (alarmEvent != null) {
var e = alarmEvent; var e = alarmEvent;
BackgroundColorChange(e.beat, e.length, e["startColor"], e["endColor"], e["ease"]); AlarmColor(e.beat, e.length, e["startColor"], e["endColor"], e["ease"]);
} else { } else {
BackgroundColorChange(0, 0, Color.white, Color.white, 0); AlarmColor(0, 0, alarmColor, alarmColor, (int)Util.EasingFunction.Ease.Instant);
} }
} }
public override void OnPlay(double beat)
{
OnGameSwitch(beat);
}
public override void OnLateBeatPulse(double beat) public override void OnLateBeatPulse(double beat)
{ {
if (alarmBop) { if (alarmBop) {
@ -178,22 +170,16 @@ namespace HeavenStudio.Games
public void AlarmColor(double beat, float length, Color startColor, Color endColor, int ease) public void AlarmColor(double beat, float length, Color startColor, Color endColor, int ease)
{ {
alarmColorEase = new(beat, length, startColor, endColor, ease); aStartBeat = beat;
} aLength = length;
aStartColor = startColor;
public void BackgroundColorChange(double beat, float length, Color startColor, Color endColor, int ease) aEndColor = endColor;
{ aEase = (Util.EasingFunction.Ease)ease;
bgColorEase = new(beat, length, startColor, endColor, ease); aEaseFunc = Util.EasingFunction.GetEasingFunction(aEase);
}
public static void CanSFX(double beat)
{
SoundByte.PlayOneShotGame("cannery/ding", beat);
} }
public void SendCan(double beat) public void SendCan(double beat)
{ {
Debug.Log(dingAnim);
// do the ding animation on the beat // do the ding animation on the beat
BeatAction.New(this, new() { new(beat, delegate { dingAnim.DoScaledAnimationAsync("Ding", 0.5f); }) }); BeatAction.New(this, new() { new(beat, delegate { dingAnim.DoScaledAnimationAsync("Ding", 0.5f); }) });

View file

@ -428,42 +428,6 @@ namespace HeavenStudio.Games
#endregion #endregion
#region Color
public struct ColorEase
{
public double startBeat;
public float length;
public Color startColor, endColor;
public Util.EasingFunction.Ease ease;
public readonly Util.EasingFunction.Function easeFunc;
public ColorEase(double startBeat, float length, Color startColor, Color endColor, int ease) {
this.startBeat = startBeat;
this.length = length;
(this.startColor, this.endColor) = (startColor, endColor);
this.ease = (Util.EasingFunction.Ease)ease;
this.easeFunc = Util.EasingFunction.GetEasingFunction(this.ease);
}
public ColorEase(Color color) {
startBeat = length = 0;
startColor = endColor = color;
this.ease = Util.EasingFunction.Ease.Instant;
this.easeFunc = Util.EasingFunction.GetEasingFunction(this.ease);
}
}
public Color GetNewColor(ColorEase ce) => GetNewColor(ce.startBeat, ce.length, ce.startColor, ce.endColor, ce.easeFunc);
public Color GetNewColor(double beat, float length, Color start, Color end, Util.EasingFunction.Function func)
{
float normalizedBeat = beat == 0 && length == 0 ? 1 : Mathf.Clamp01(Conductor.instance.GetPositionFromBeat(beat, length));
float newR = func(start.r, end.r, normalizedBeat);
float newG = func(start.g, end.g, normalizedBeat);
float newB = func(start.b, end.b, normalizedBeat);
return new Color(newR, newG, newB);
}
#endregion
private void OnDestroy() private void OnDestroy()
{ {
foreach (var evt in scheduledInputs) foreach (var evt in scheduledInputs)