Down sound added (#422)

This commit is contained in:
Rapandrasmus 2023-05-18 22:12:06 +02:00 committed by GitHub
parent 824de6ca1d
commit b593bc42ae
4 changed files with 52 additions and 174 deletions

View file

@ -453,7 +453,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3584310800769874311}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7463739741518075090
SpriteRenderer:
@ -904,17 +904,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 848efddf5f5eaa94eacf8601e36f81bf, type: 3}
m_Name:
m_EditorClassIdentifier:
inList: 0
state:
gameObject: {fileID: 0}
early: 0
perfect: 0
late: 0
createBeat: 0
eligibleHitsList: []
aceTimes: 0
isEligible: 0
triggersAutoplay: 1
canKick: 0
canHighKick: 0
kickLeft: 0
@ -1211,17 +1200,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 848efddf5f5eaa94eacf8601e36f81bf, type: 3}
m_Name:
m_EditorClassIdentifier:
inList: 0
state:
gameObject: {fileID: 0}
early: 0
perfect: 0
late: 0
createBeat: 0
eligibleHitsList: []
aceTimes: 0
isEligible: 0
triggersAutoplay: 1
canKick: 0
canHighKick: 0
kickLeft: 0
@ -1313,7 +1291,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3584310800769874311}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8255833927689275432
MeshFilter:
@ -1426,7 +1404,6 @@ Transform:
m_Children:
- {fileID: 2191273313861422334}
- {fileID: 1133941631262721853}
- {fileID: 2021733110626493915}
- {fileID: 3997811236443330485}
- {fileID: 45563227638450708}
- {fileID: 32085857618286105}
@ -1463,7 +1440,7 @@ MonoBehaviour:
- tag:
pos: {x: 1.5724581, y: -1.3358305, z: 0}
target: {fileID: 0}
height: 4.1
height: 5
duration: 1.4
useLastRealPos: 1
values: []
@ -1479,14 +1456,14 @@ MonoBehaviour:
anchor: {fileID: 0}
positions:
- tag:
pos: {x: -3.900663, y: -6.300388, z: 0}
pos: {x: -6, y: -6, z: 0}
target: {fileID: 0}
height: 10
duration: 2.35
useLastRealPos: 0
values: []
- tag:
pos: {x: 2.5349154, y: -6.116786, z: 0}
pos: {x: -1, y: -6, z: 0}
target: {fileID: 0}
height: 0
duration: 0
@ -1504,7 +1481,7 @@ MonoBehaviour:
useLastRealPos: 1
values: []
- tag:
pos: {x: -0.44, y: -5.756623, z: 0}
pos: {x: -3.5, y: -6, z: 0}
target: {fileID: 0}
height: 0
duration: 0
@ -1782,104 +1759,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &4365805729759623217
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2021733110626493915}
- component: {fileID: 9095461183267835975}
- component: {fileID: 8422221005665590405}
m_Layer: 0
m_Name: kickFX
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2021733110626493915
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4365805729759623217}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.67, y: -1.05, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3584310800769874311}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &9095461183267835975
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4365805729759623217}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 9
m_Sprite: {fileID: -6047660829741247071, guid: ed47c3fa4e916ff478c0f1b6fb057aa4, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 0.48235294}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &8422221005665590405
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4365805729759623217}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54588eb7ee0680643aeaf61dcf609903, type: 3}
m_Name:
m_EditorClassIdentifier:
time: 0.08
--- !u!1 &4832865564766322567
GameObject:
m_ObjectHideFlags: 0
@ -2665,7 +2544,6 @@ MonoBehaviour:
kicker: {fileID: 0}
holder: {fileID: 7976131226454805035}
spriteHolder: {fileID: 6132156590540490080}
kickFX: {fileID: 4365805729759623217}
startBeat: 0
state: 0
nextAnimBeat: 0
@ -2786,7 +2664,7 @@ Transform:
m_Children:
- {fileID: 2966367777699113700}
m_Father: {fileID: 3584310800769874311}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8605359988194706959
GameObject:

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 63b8cc7b1c3460e4eb3f12bf288045f9
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View file

@ -16,7 +16,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
[HideInInspector] public Kicker kicker;
[SerializeField] private GameObject holder;
[SerializeField] private GameObject spriteHolder;
[SerializeField] private GameObject kickFX;
[Space(10)]
//[SerializeField] private BezierCurve3D dispenseCurve;
//[SerializeField] private BezierCurve3D kickCurve;
@ -148,8 +147,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//kickCurve.KeyPoints[0].transform.position = holder.transform.position;
//kickPath.positions[0].pos = holder.transform.position;
UpdateLastRealPos();
HitFX();
}
public void HighKick()
@ -161,8 +158,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//highKickCurve.KeyPoints[0].transform.position = holder.transform.position;
//highKickPath.positions[0].pos = holder.transform.position;
UpdateLastRealPos();
HitFX();
}
public void Toe()
@ -185,9 +180,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//toeCurve.KeyPoints[1].transform.localPosition = new Vector3(6.49f, 0);
toePath.positions[1].pos = new Vector3(6.49f, 0);
}
HitFX();
}
private void Update()
@ -206,10 +198,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//dispenseCurve.KeyPoints[0].transform.position = new Vector3(kicker.transform.GetChild(0).position.x - 6f, kicker.transform.GetChild(0).position.y - 6f);
//dispenseCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.GetChild(0).position.x - 1f, kicker.transform.GetChild(0).position.y - 6f);
dispensePath.positions[0].pos = new Vector3(-6f, -6f);
dispensePath.positions[1].pos = new Vector3(-1f, -6f);
//holder.transform.localPosition = dispenseCurve.GetPoint(normalizedBeatAnim);
holder.transform.localPosition = GetPathPositionFromBeat(dispensePath, Mathf.Max(beat, startBeat), out float height, startBeat);
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(0f, -1440f, normalizedBeatAnim));
@ -219,7 +207,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, 1.5f);
kickPath.positions[0].pos = lastRealPos;
if (!lastKickLeft)
{
//kickCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.GetChild(0).position.x + 0.5f, kicker.transform.GetChild(0).position.y - 6f);
@ -244,9 +231,6 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//highKickCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.GetChild(0).position.x - 3.5f, kicker.transform.GetChild(0).position.y - 6f);
highKickPath.positions[0].pos = lastRealPos;
highKickPath.positions[1].pos = new Vector3(-3.5f, -6f);
//holder.transform.localPosition = highKickCurve.GetPoint(normalizedBeatAnim);
holder.transform.localPosition = GetPathPositionFromBeat(highKickPath, Mathf.Max(beat, startBeat), out float height, startBeat);
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, lastSpriteRot + 360f, normalizedBeatAnim));
@ -254,11 +238,9 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
}
case State.Toe:
{
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, GetAnimLength(State.Toe) + 0.35f);
//float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, GetAnimLength(State.Toe) + 0.35f);
toePath.positions[0].duration = GetAnimLength(State.Toe) + 0.35f;
toePath.positions[0].pos = lastRealPos;
if (!lastKickLeft)
{
//toeCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.GetChild(0).position.x + 0.5f, kicker.transform.GetChild(0).position.y - 6f);
@ -272,20 +254,12 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
//holder.transform.localPosition = toeCurve.GetPoint(normalizedBeatAnim);
holder.transform.localPosition = GetPathPositionFromBeat(toePath, Mathf.Max(beat, startBeat), out float height, startBeat);
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, -860f, normalizedBeatAnim));
break;
}
}
holder.transform.position = new Vector3(holder.transform.position.x, holder.transform.position.y, kicker.transform.GetChild(0).position.z);
}
private void HitFX()
{
GameObject kickfx = Instantiate(kickFX.gameObject, SpaceSoccer.instance.transform);
kickfx.SetActive(true);
kickfx.transform.position = holder.transform.position;
}
private void SetState(State newState)
{
state = newState;

View file

@ -14,13 +14,17 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("ball dispense", "Ball Dispense")
{
function = delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat, !eventCaller.currentEntity["toggle"]); },
function = delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat, !eventCaller.currentEntity["toggle"], false, eventCaller.currentEntity["down"]); },
defaultLength = 2f,
parameters = new List<Param>()
{
new Param("toggle", false, "Disable Sound", "Disables the dispense sound")
new Param("toggle", false, "Disable Sound", "Disables the dispense sound"),
new Param("down", false, "Down Sound", "Will the Down sound be played?")
},
inactiveFunction = delegate { if (!eventCaller.currentEntity["toggle"]) { SpaceSoccer.DispenseSound(eventCaller.currentEntity.beat); } }
inactiveFunction = delegate
{
if (!eventCaller.currentEntity["toggle"]) { SpaceSoccer.DispenseSound(eventCaller.currentEntity.beat, eventCaller.currentEntity["down"]);}
}
},
new GameAction("high kick-toe!", "High Kick-Toe!")
{
@ -91,11 +95,11 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("scroll", "Scrolling Background")
{
function = delegate { var e = eventCaller.currentEntity; SpaceSoccer.instance.UpdateScrollSpeed(e.beat, e["x"], e["y"]); },
function = delegate { var e = eventCaller.currentEntity; SpaceSoccer.instance.UpdateScrollSpeed(e["x"], e["y"]); },
defaultLength = 1f,
parameters = new List<Param>() {
new Param("x", new EntityTypes.Float(-5f, 5f, 0.045f), "Horizontal", "How many horizontal loops in 1 beat?"),
new Param("y", new EntityTypes.Float(-5f, 5f, 0.16f), "Vertical", "How many vertical loops in 1 beat?"),
new Param("x", new EntityTypes.Float(-5f, 5f, 0.09f), "Horizontal", "How fast does the background move horizontally?"),
new Param("y", new EntityTypes.Float(-5f, 5f, 0.32f), "Vertical", "How fast does the background move vertically?"),
}
},
new GameAction("stopBall", "Stop Ball")
@ -195,8 +199,8 @@ namespace HeavenStudio.Games
float scrollBeat;
float scrollOffsetX;
float scrollOffsetY;
float currentScrollLengthX = 0.045f;
float currentScrollLengthY = 0.16f;
float currentScrollLengthX = 0.09f;
float currentScrollLengthY = 0.32f;
Tween bgColorTween;
Tween dotColorTween;
#region Space Kicker Position Easing
@ -234,8 +238,8 @@ namespace HeavenStudio.Games
private void Update()
{
var cond = Conductor.instance;
float normalizedX = (cond.songPositionInBeats - scrollBeat) * currentScrollLengthX;
float normalizedY = (cond.songPositionInBeats - scrollBeat) * currentScrollLengthY;
float normalizedX = (Time.realtimeSinceStartup - scrollBeat) * currentScrollLengthX;
float normalizedY = (Time.realtimeSinceStartup - scrollBeat) * currentScrollLengthY;
backgroundSprite.NormalizedX = -scrollOffsetX - normalizedX;
backgroundSprite.NormalizedY = -scrollOffsetY - normalizedY;
@ -329,14 +333,13 @@ namespace HeavenStudio.Games
return default(SuperCurveObject.Path);
}
public void UpdateScrollSpeed(float beat, float scrollSpeedX, float scrollSpeedY)
public void UpdateScrollSpeed(float scrollSpeedX, float scrollSpeedY)
{
var cond = Conductor.instance;
scrollOffsetX = (cond.songPositionInBeats - scrollBeat) * currentScrollLengthX;
scrollOffsetY = (cond.songPositionInBeats - scrollBeat) * currentScrollLengthY;
scrollOffsetX = (Time.realtimeSinceStartup - scrollBeat) * currentScrollLengthX;
scrollOffsetY = (Time.realtimeSinceStartup - scrollBeat) * currentScrollLengthY;
currentScrollLengthX = scrollSpeedX;
currentScrollLengthY = scrollSpeedY;
scrollBeat = beat;
scrollBeat = Time.realtimeSinceStartup;
}
public void EaseSpaceKickersPositions(float beat, float length, int ease, float xDistance, float yDistance, float zDistance)
@ -439,7 +442,7 @@ namespace HeavenStudio.Games
if (ballDispensed) Dispense(lastDispensedBeat, false, true);
}
public void Dispense(float beat, bool playSound = true, bool ignorePlayer = false)
public void Dispense(float beat, bool playSound = true, bool ignorePlayer = false, bool playDown = false)
{
if (!ballDispensed) lastDispensedBeat = beat;
ballDispensed = true;
@ -456,7 +459,7 @@ namespace HeavenStudio.Games
ball_.Init(kicker, beat);
if (kicker.player && playSound)
{
DispenseSound(beat);
DispenseSound(beat, playDown);
}
kicker.DispenseBall(beat);
@ -464,8 +467,9 @@ namespace HeavenStudio.Games
}
}
public static void DispenseSound(float beat)
public static void DispenseSound(float beat, bool playDown)
{
if (playDown) Jukebox.PlayOneShot("games/spaceSoccer/down", beat);
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("spaceSoccer/dispenseNoise", beat),