Merge pull request #128 from Mytiaoga/master

First Contact & DJ School updates
This commit is contained in:
minenice55 2022-07-08 10:58:07 -04:00 committed by GitHub
commit 4d3e330f90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 5114 additions and 4337 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -15,10 +15,48 @@ AudioMixerGroupController:
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: -3827691611382659438}
- {fileID: -7417416911555589299}
- {fileID: -4864457926502934139}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!244 &-7417416911555589299
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: 5b8f1b47430c37f4aa6afd61b4f32eec
m_EffectName: Highpass
m_MixLevel: c5fb06afbdfde63429bee2da9ea91189
m_Parameters:
- m_ParameterName: Cutoff freq
m_GUID: 34d86eacd61c28340b115290d5f25b76
- m_ParameterName: Resonance
m_GUID: 10bb5a0f2787ab54db70b685b5d01d0b
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &-4864457926502934139
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: 5739ec919cbf73c429b7bfd3d5c17692
m_EffectName: Lowpass
m_MixLevel: bf479ffff7901754b93db8cd04a5b69b
m_Parameters:
- m_ParameterName: Cutoff freq
m_GUID: 89e57fda42bbd884c9b50b8cfffb46f6
- m_ParameterName: Resonance
m_GUID: 1505a38b6ed3ac044b1b27d1e026ee10
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &-3827691611382659438
AudioMixerEffectController:
m_ObjectHideFlags: 3
@ -104,13 +142,32 @@ AudioMixerSnapshotController:
m_SnapshotID: cbd5c1fb10b276940af4ad86481f0172
m_FloatValues:
9dd04840cf4676047b2e26e659ca4069: 1661
65da18c00dad8f642a1f04b10bc4d3fa: -9.8
2b8f30d01b6887a4a9a1c346efb59529: 0.96
152a0691009a459488775726d7da2a76: 0
b32285822a3582a46bc02ae0bb31edd0: 0
16419c92ecf0c4743a61bae82f0cd39d: 0.96
3537f1d2761ea514aad24adbde59814c: 0.5
9cca3334388db1b4cb9a564a2d81e1d9: 2909
44f9a634893e4074e976e9bbdd1798de: 2909
43b77be4dcaecc64dad266d1ce7ec63b: 0
4bc95d762bab08f4397b7609394e744d: 0
df5d5286217f286439c16cde82518c34: 0
3efb01d650e14ea499166db104c3fef0: 1661
03f31c284979509419018c8192731634: 2064
9032eb9801098ed4eaa00396d75cac0c: -9.8
5236511a7a103314ba1c738dd5b09f64: 2064
994ac19a5841d5747a8d4e85c1068fb2: 10
89e57fda42bbd884c9b50b8cfffb46f6: 22000
97da122bdf1007b4dbcb38293f8ad4ce: 6983
46ae8f9b0a8b2c94da3f936b6675c718: 4
1b5e174cdc33a544cb4195a5aba09219: 4
34d86eacd61c28340b115290d5f25b76: 10
74a2868d38bb05a40b9f820d98dfc3a9: -10000
8170201e04f44b44fa0a6811cbd98865: 0.1
7392d42e828461d4fbea16ee69eecec3: 0.06
3549d05eae7b26c42ba4beb170a39a43: 0.96
4963fceebf3ef7c499597c1c62bdc06b: 0.96
0d54293f1eb308e4f9eb23e744bae623: 1
911cb1bf4bb1b624ab3a68e1eb57ba29: 10
m_TransitionOverrides: {}
@ -124,15 +181,19 @@ AudioMixerSnapshotController:
m_AudioMixer: {fileID: 24100000}
m_SnapshotID: 63d5780e5b890af43a13ba2a5e7fd23d
m_FloatValues:
8ac1b110f403261418b718a0a6962426: -9.8
9dd04840cf4676047b2e26e659ca4069: 1661
152a0691009a459488775726d7da2a76: 0
152a0691009a459488775726d7da2a76: 16
b32285822a3582a46bc02ae0bb31edd0: 0
3537f1d2761ea514aad24adbde59814c: 0.5
1f89dac5f0e643c4ab8774d8ad05e968: 2.79
4bc95d762bab08f4397b7609394e744d: 0
3efb01d650e14ea499166db104c3fef0: 1661
994ac19a5841d5747a8d4e85c1068fb2: 1121
89e57fda42bbd884c9b50b8cfffb46f6: 2064
97da122bdf1007b4dbcb38293f8ad4ce: 6983
34d86eacd61c28340b115290d5f25b76: 2909
3890ccbecfbaacd42a9fda6a955eeab8: 4
0d54293f1eb308e4f9eb23e744bae623: 3.99
911cb1bf4bb1b624ab3a68e1eb57ba29: 7184
m_TransitionOverrides: {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: cef4312d99e58974a96782f10bca78f9
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
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
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
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: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,91 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TextboxSDFMaterial
m_Shader: {fileID: 4800000, guid: 777678d31f953e04e8f15812003b9c27, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _OutSmoothness: 0.025
- _OutThickness: 0.9
- _Parallax: 0.02
- _SDFThreshold: 0.5
- _Smoothness: 0.025
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _Thickness: 0.8
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _OutColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8bf75b500692c234daf2d17ad891f66b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 82c4853aee62f094682396664577c631
TextureImporter:
internalIDToNameTable:
- first:
213: 1280609944595656088
second: interpreterTextbox0_0
- first:
213: 3351327113491225332
second: interpreterTextbox0_1
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 0
alignment: 9
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 87, y: 197, z: 98, w: 203}
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
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
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: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: interpreterTextbox0_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 512
height: 512
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 73, y: 239, z: 186, w: 203}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 89de47ba5f3a5c110800000000000000
internalID: 1280609944595656088
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -5,6 +5,15 @@ TextureImporter:
- first:
213: 484124400209634000
second: interpreterTextboxes_0
- first:
213: -7876428232389808301
second: interpreterTextboxes_1
- first:
213: -2508620102671554880
second: interpreterTextboxes_2
- first:
213: 4953631840317161205
second: interpreterTextboxes_3
externalObjects: {}
serializedVersion: 11
mipmaps:
@ -99,7 +108,7 @@ TextureImporter:
serializedVersion: 2
x: 0
y: 513
width: 510
width: 511
height: 511
alignment: 0
pivot: {x: 0, y: 0}
@ -114,6 +123,48 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: interpreterTextboxes_1
rect:
serializedVersion: 2
x: 513
y: 513
width: 511
height: 511
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 35f2c85f04e41b290800000000000000
internalID: -7876428232389808301
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: interpreterTextboxes_2
rect:
serializedVersion: 2
x: 0
y: 0
width: 511
height: 511
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 0c6abdfce479f2dd0800000000000000
internalID: -2508620102671554880
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

View file

@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: f844d9227d1dcc14399e9691e760481d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 3
wrapV: 3
wrapW: 3
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 0
alignment: 8
spritePivot: {x: 1, y: 0}
spritePixelsToUnits: 100
spriteBorder: {x: 57, y: 0, z: 0, w: 57}
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
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
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: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
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: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -11,7 +11,11 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("djSchool", "DJ School", "008c97", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
//new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.toggle); }, 0.5f, false, new List<Param>()
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}),
new GameAction("and stop ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e.toggle); }, 2.5f, false, new List<Param>()
{
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
@ -25,6 +29,14 @@ namespace HeavenStudio.Games.Loaders
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
}),
new GameAction("dj voice lines", delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 2f, false, new List<Param>()
{
new Param("type", DJSchool.DJVoiceLines.CheckItOut, "Voice Lines", "The voice line to play"),
}),
new GameAction("sound FX", delegate { DJSchool.instance.soundFX(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
{
new Param("toggle", false, "Radio FX", "Toggle on and off for Radio Effects")
})
},
new List<string>() {"ntr", "normal"},
"ntrdj", "en",
@ -47,16 +59,31 @@ namespace HeavenStudio.Games
Hyped
}
public enum DJVoiceLines
{
CheckItOut,
LetsGo,
OhYeah,
OhYeahAlt,
Yay
}
[Header("Components")]
[SerializeField] private Student student;
[SerializeField] private GameObject djYellow;
private Animator djYellowAnim;
[SerializeField] private SpriteRenderer headSprite;
[SerializeField] private Sprite[] headSprites;
private float lastReportedBeat = 0f;
[Header("Properties")]
public GameEvent bop = new GameEvent();
private bool djYellowHolding;
public bool andStop;
public bool goBop;
public float beatOfInstance;
public static DJSchool instance { get; private set; }
@ -65,53 +92,117 @@ namespace HeavenStudio.Games
instance = this;
djYellowAnim = djYellow.GetComponent<Animator>();
student.Init();
goBop = true;
}
private void Update()
{
var cond = Conductor.instance;
#region old script
//var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
//if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
//{
// if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
// {
// if (student.anim.IsAnimationNotPlaying())
// {
// if (student.isHolding)
// {
// student.anim.Play("HoldBop", 0, 0);
// }
// else
// {
// student.anim.Play("IdleBop", 0, 0);
// }
// }
// if (djYellowAnim.IsAnimationNotPlaying())
// {
// var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
// if (yellowState.IsName("Hey"))
// {
// PostScratchoFace();
// }
// if (djYellowHolding)
// {
// djYellowAnim.Play("HoldBop", 0, 0);
// }
// else
// {
// // todo: split between left and right bop based on beat
// djYellowAnim.Play("IdleBop", 0, 0);
// }
// }
// }
//}
#endregion
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
{
if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
if (goBop)
{
if (student.anim.IsAnimationNotPlaying())
if (student.isHolding)
{
if (student.isHolding)
{
student.anim.Play("HoldBop", 0, 0);
}
else
{
student.anim.Play("IdleBop", 0, 0);
}
student.anim.Play("HoldBop", 0, 0);
}
if (djYellowAnim.IsAnimationNotPlaying())
else if (!student.swiping && student.anim.IsAnimationNotPlaying())
{
var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
if (yellowState.IsName("Hey"))
{
PostScratchoFace();
}
student.anim.Play("IdleBop", 0, 0);
}
if (djYellowHolding)
{
djYellowAnim.Play("HoldBop", 0, 0);
}
else
{
// todo: split between left and right bop based on beat
djYellowAnim.Play("IdleBop", 0, 0);
}
var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
if (yellowState.IsName("Hey"))
{
PostScratchoFace();
}
if (!andStop && !djYellowHolding)
{
djYellowAnim.Play("IdleBop", 0, 0);
}
else if (djYellowHolding)
{
djYellowAnim.Play("HoldBop", 0, 0);
}
}
}
else if (Conductor.instance.songPositionInBeats < lastReportedBeat)
{
lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats);
}
if(PlayerInput.Pressed() && !IsExpectingInputNow() && !student.isHolding) //Start hold miss
{
student.OnMissHoldForPlayerInput();
student.isHolding = true;
}
else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && student.isHolding) //Let go during hold
{
student.UnHold();
}
//else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && !student.isHolding)
//{
// student.OnMissSwipeForPlayerInput();
//}
}
public void Bop(float beat, float length)
//public void Bop(float beat, float length)
//{
// bop.startBeat = beat;
// bop.length = length;
//}
public void Bop(bool isBopping)
{
bop.startBeat = beat;
bop.length = length;
if (isBopping)
{
goBop = true;
}
else
{
goBop = false;
}
}
public void BreakCmon(float beat, int type, bool ooh)
@ -148,19 +239,20 @@ namespace HeavenStudio.Games
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); SetupCue(beat, false); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
new BeatAction.Action(beat + 2f, delegate
{
djYellow.GetComponent<Animator>().Play("Hold", 0, 0);
djYellowHolding = true;
}),
});
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
}
public void AndStop(float beat, bool ooh)
{
if (djYellowHolding) return;
var sound = new MultiSound.Sound[]
{
new MultiSound.Sound("djSchool/andStop1", beat),
@ -175,13 +267,16 @@ namespace HeavenStudio.Games
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); SetupCue(beat - 0.5f, false); }),
new BeatAction.Action(beat + 0.5f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
new BeatAction.Action(beat + 1.5f, delegate
{
djYellow.GetComponent<Animator>().Play("Hold", 0, 0);
djYellowHolding = true;
}),
});
andStop = true;
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
}
public void ScratchoHey(float beat, int type)
@ -213,25 +308,34 @@ namespace HeavenStudio.Games
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho2", 0, 0); SetupCue(beat, true); }),
new BeatAction.Action(beat + .5f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho2", 0, 0); }),
//new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); SetupCue(beat, true); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
new BeatAction.Action(beat + 2.05f, delegate
{
djYellow.GetComponent<Animator>().Play("Hey", 0, 0);
djYellowHolding = false;
}),
});
beatOfInstance = beat;
ScheduleInput(beat, 2f, InputType.STANDARD_UP, student.OnHitSwipe, student.OnMissSwipe, student.OnEmpty);
andStop = false;
}
void SetupCue(float beat, bool swipe)
{
if (swipe)
student.swipeBeat = beat;
else
student.holdBeat = beat;
//void SetupCue(float beat, bool swipe)
//{
// if (swipe)
// student.swipeBeat = beat;
// else
// student.holdBeat = beat;
student.eligible = true;
student.ResetState();
}
// student.eligible = true;
// student.ResetState();
//}
public void SetDJYellowHead(int type, bool resetAfterBeats = false)
{
@ -268,5 +372,67 @@ namespace HeavenStudio.Games
SetDJYellowHead(2, true);
}
}
public void soundFX(bool toggle)
{
student.soundFX = toggle;
}
public void voiceLines(float beat, int type)
{
string[] sounds;
var sound = new MultiSound.Sound[] { };
switch (type)
{
case 0:
sounds = new string[] { "djSchool/checkItOut1", "djSchool/checkItOut2", "djSchool/checkItOut3" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .25f),
new MultiSound.Sound(sounds[2], beat + .5f),
};
MultiSound.Play(sound);
break;
case 1:
sounds = new string[] { "djSchool/letsGo1", "djSchool/letsGo2" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
};
MultiSound.Play(sound);
break;
case 2:
sounds = new string[] { "djSchool/ohYeah1", "djSchool/ohYeah2" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
};
MultiSound.Play(sound);
break;
case 3:
sounds = new string[] { "djSchool/ohYeahAlt1", "djSchool/ohYeahAlt2", "djSchool/ohYeahAlt3" };
sound = new MultiSound.Sound[]
{
new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .5f),
new MultiSound.Sound(sounds[2], beat + 1f),
};
MultiSound.Play(sound);
break;
case 4:
Jukebox.PlayOneShotGame("djSchool/yay");
break;
}
}
}
}

View file

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using DG.Tweening;
using HeavenStudio.Util;
@ -19,6 +20,8 @@ namespace HeavenStudio.Games.Scripts_DJSchool
public bool shouldBeHolding;
public bool eligible;
public bool missed;
public bool swiping;
public bool soundFX;
[Header("Components")]
[SerializeField] private SpriteRenderer flash;
@ -26,6 +29,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
[SerializeField] private GameObject flashFXInverse;
[SerializeField] private GameObject TurnTable;
[SerializeField] private GameObject slamFX;
AudioMixerGroup mixer;
private Animator tableAnim;
@ -37,103 +41,91 @@ namespace HeavenStudio.Games.Scripts_DJSchool
anim = GetComponent<Animator>();
tableAnim = TurnTable.GetComponent<Animator>();
tableAnim.speed = 0;
mixer = Resources.Load<AudioMixer>("MainMixer").FindMatchingGroups("Music")[0];
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
private void Update()
{
float beatToUse = shouldBeHolding ? swipeBeat : holdBeat;
float normalizedBeat = Conductor.instance.GetPositionFromMargin(beatToUse + 2, 1);
if (eligible)
{
StateCheck(normalizedBeat);
if (normalizedBeat > Minigame.LateTime())
{
eligible = false;
missed = true;
if (shouldBeHolding)
{
shouldBeHolding = false;
}
else
{
shouldBeHolding = true;
game.SetDJYellowHead(3);
}
}
}
if (!isHolding)
{
if (PlayerInput.Pressed())
{
if (!shouldBeHolding && state.perfect && eligible)
{
Hold(true);
eligible = false;
}
else
{
if (!shouldBeHolding)
eligible = false;
Hold(false);
missed = true;
game.SetDJYellowHead(3, true);
}
}
}
else
{
if (PlayerInput.PressedUp())
{
if (shouldBeHolding && state.perfect && eligible)
{
Swipe(true);
eligible = false;
}
else
{
if (shouldBeHolding)
{
Swipe(false);
eligible = false;
}
else
{
UnHold();
}
missed = true;
game.SetDJYellowHead(3);
}
}
}
}
public void Hold(bool ace)
#region old hold
//public void Hold(bool ace)
//{
// isHolding = true;
// if (ace)
// {
// missed = false;
// shouldBeHolding = true;
// game.SetDJYellowHead(1);
// }
// Jukebox.PlayOneShotGame("djSchool/recordStop");
// anim.Play("Hold", 0, 0);
// tableAnim.Play("Student_Turntable_Hold", 0, 0);
// if (ace)
// {
// if (soundFX)
// {
// Conductor.instance.djSchoolHold.TransitionTo(.01f);
// }
// FlashFX(true);
// }
// // Settings.GetMusicMixer().audioMixer.FindSnapshot("DJSchool_Hold").TransitionTo(0.15f);
//}
#endregion
#region onHold
public void OnHitHold(PlayerActionEvent caller, float beat)
{
isHolding = true;
if (ace)
{
missed = false;
shouldBeHolding = true;
game.SetDJYellowHead(1);
}
missed = false;
shouldBeHolding = true;
game.SetDJYellowHead(1);
Jukebox.PlayOneShotGame("djSchool/recordStop");
anim.Play("Hold", 0, 0);
//tableAnim.Play("Student_Turntable_Hold", 0, 0);
if (ace)
if (soundFX)
{
FlashFX(true);
mixer.audioMixer.FindSnapshot("DJSchool_Hold").TransitionTo(.01f);
}
FlashFX(true);
}
// Settings.GetMusicMixer().audioMixer.FindSnapshot("DJSchool_Hold").TransitionTo(0.15f);
public void OnMissHold(PlayerActionEvent caller)
{
//isHolding = true;
missed = true;
game.SetDJYellowHead(3, true);
}
public void OnMissHoldForPlayerInput()
{
isHolding = true;
missed = true;
game.SetDJYellowHead(3, true);
Jukebox.PlayOneShotGame("djSchool/recordStop");
anim.Play("Hold", 0, 0);
//tableAnim.Play("Student_Turntable_Hold", 0, 0);
}
#endregion
public void OnEmpty(PlayerActionEvent caller)
{
//empty
}
public void UnHold()
@ -141,50 +133,125 @@ namespace HeavenStudio.Games.Scripts_DJSchool
isHolding = false;
anim.Play("Unhold", 0, 0);
// Settings.GetMusicMixer().audioMixer.FindSnapshot("Main").TransitionTo(0.15f);
missed = true;
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
public void Swipe(bool ace)
#region onSwipe
public void OnHitSwipe(PlayerActionEvent caller, float beat)
{
isHolding = false;
if (ace)
if (!missed)
{
isHolding = false;
missed = false;
shouldBeHolding = false;
Jukebox.PlayOneShotGame("djSchool/recordSwipe");
FlashFX(false);
swiping = true;
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Swipe", 0, 0); }),
new BeatAction.Action(beat + 4f, delegate { swiping = false; }),
});
//anim.Play("Swipe", 0, 0);
tableAnim.speed = 1;
tableAnim.Play("Student_Turntable_Swipe", 0, 0);
Instantiate(slamFX).SetActive(true);
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
else
{
// Missed record swipe sound should play here.
OnMissSwipeForPlayerInput();
Jukebox.PlayOneShotGame("djSchool/recordSwipe");
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Swipe", 0, 0); }),
new BeatAction.Action(beat + 4f, delegate { swiping = false; }),
});
//anim.Play("Swipe", 0, 0);
tableAnim.speed = 1;
tableAnim.Play("Student_Turntable_Swipe", 0, 0);
Instantiate(slamFX).SetActive(true);
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
anim.Play("Swipe", 0, 0);
tableAnim.speed = 1;
tableAnim.Play("Student_Turntable_Swipe", 0, 0);
Instantiate(slamFX).SetActive(true);
// Settings.GetMusicMixer().audioMixer.FindSnapshot("Main").TransitionTo(0.15f);
}
public override void OnAce()
public void OnMissSwipe(PlayerActionEvent caller)
{
if (!shouldBeHolding)
{
Hold(true);
}
else
{
Swipe(true);
}
eligible = false;
isHolding = false;
//swiping = false;
missed = true;
game.SetDJYellowHead(3);
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
public void OnMissSwipeForPlayerInput()
{
isHolding = false;
missed = true;
game.SetDJYellowHead(3);
//swiping = false;
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
#endregion
#region old swipe
//public void Swipe(bool ace)
//{
// isHolding = false;
// if (ace)
// {
// missed = false;
// shouldBeHolding = false;
// Jukebox.PlayOneShotGame("djSchool/recordSwipe");
// FlashFX(false);
// swiping = true;
// }
// else
// {
// // Missed record swipe sound should play here.
// }
// anim.Play("Swipe", 0, 0);
// tableAnim.speed = 1;
// tableAnim.Play("Student_Turntable_Swipe", 0, 0);
// Instantiate(slamFX).SetActive(true);
// Conductor.instance.normal.TransitionTo(.01f);
// // Settings.GetMusicMixer().audioMixer.FindSnapshot("Main").TransitionTo(0.15f);
// swiping = false;
//}
//public override void OnAce()
//{
// if (!shouldBeHolding)
// {
// //Hold(true);
// }
// else
// {
// Conductor.instance.normal.TransitionTo(.01f);
// //Swipe(true);
// }
// eligible = false;
//}
#endregion
private void FlashFX(bool inverse)
{
GameObject prefab = flashFX;
@ -194,11 +261,10 @@ namespace HeavenStudio.Games.Scripts_DJSchool
GameObject flashFX_ = Instantiate(prefab, this.transform.parent);
flashFX_.SetActive(true);
Destroy(flashFX_, 0.5f);
flash.color = "D0FBFF".Hex2RGB();
flash.color = new Color(flash.color.r, flash.color.g, flash.color.b, 0.85f);
flash.DOColor(new Color(flash.color.r, flash.color.g, flash.color.b, 0), 0.15f);
Destroy(flashFX_, 0.5f);
}
public void TransitionBackToIdle()
@ -210,5 +276,12 @@ namespace HeavenStudio.Games.Scripts_DJSchool
anim.Play("Idle", 0, 0);
}
}
//Not sure but will do?
private void OnDestroy()
{
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
}
}
}

View file

@ -1,113 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Games.Scripts_FirstContact
{
public class AlienFirstContact : PlayerActionObject
{
public float createBeat;
FirstContact game;
Translator translator;
bool hasSpoke;
public float stateBeat;
public bool prefabHolder;
bool missed;
private void Awake()
{
game = FirstContact.instance;
translator = GameObject.Find("Games/firstContact/Translator").GetComponent<Translator>();
}
private void Start()
{
}
private void Update()
{
if (hasSpoke)
{
return;
}
stateBeat = Conductor.instance.GetPositionFromMargin(createBeat + game.beatInterval, 1f);
StateCheck(stateBeat);
if (PlayerInput.Pressed(true))
{
if (state.eligible())
{
if (!game.hasMissed)
{
Ace();
}
else
{
Eh();
}
}
else if (state.notPerfect() && game.translatorSpeakCount > 0)
{
Eh();
}
//else if (stateBeat > Minigame.LateTime() && game.translatorSpeakCount == 0)
//{
// //Debug.Log("OW");
// Miss();
//}
}
if (stateBeat > Minigame.LateTime())
{
if (!missed)
{
MissNoHit();
}
}
}
public void Ace()
{
translator.successTranslation(true);
game.isCorrect = true;
game.translatorSpeakCount++;
hasSpoke = true;
missed = false;
}
public void Miss()
{
translator.successTranslation(false);
game.isCorrect = false;
hasSpoke = true;
missed = false;
}
public void MissNoHit()
{
game.alienNoHit();
game.isCorrect = false;
missed = true;
game.hasMissed = true;
}
public void Eh()
{
translator.ehTranslation();
hasSpoke = true;
}
public override void OnAce()
{
Ace();
}
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 47ef82bd935047f42b39142f4a1b1d32
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -5,7 +5,6 @@ using HeavenStudio.Util;
namespace HeavenStudio.Games.Loaders
{
using static Minigames;
public static class CtrFirstContact
{
public static Minigame AddGame(EventCaller eventCaller)
@ -13,7 +12,10 @@ namespace HeavenStudio.Games.Loaders
return new Minigame("firstContact", "First Contact", "008c97", false, false, new List<GameAction>()
{
new GameAction("beat intervals", delegate { FirstContact.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
new GameAction("alien speak", delegate { FirstContact.instance.alienSpeak(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("alien speak", delegate { FirstContact.instance.alienSpeak(eventCaller.currentEntity.beat, eventCaller.currentEntity.valA); }, 0.5f, false, new List<Param>()
{
new Param("valA", new EntityTypes.Float(.8f, 1.5f, 1f), "Pitch")
}),
new GameAction("alien turnover", delegate { FirstContact.instance.alienTurnOver(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("alien success", delegate { FirstContact.instance.alienSuccess(eventCaller.currentEntity.beat); }, 1f, false),
new GameAction("mission control", delegate { FirstContact.instance.missionControlDisplay(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle); }, 1f, false, new List<Param>
@ -30,14 +32,14 @@ namespace HeavenStudio.Games.Loaders
//{
// new Param("type", FirstContact.VersionOfContact.FirstContact, "Version", "Version of First Contact to play"),
//}),
});
});
}
}
}
namespace HeavenStudio.Games
{
using Scripts_FirstContact;
//using Scripts_FirstContact;
public class FirstContact : Minigame
{
@ -51,8 +53,8 @@ namespace HeavenStudio.Games
[Header("Components")]
[SerializeField] GameObject alien;
[SerializeField] Translator translator;
[SerializeField] GameObject alienSpeech;
[SerializeField] GameObject translator;
//[SerializeField] GameObject alienSpeech;
[SerializeField] GameObject dummyHolder;
[SerializeField] GameObject missionControl;
[SerializeField] GameObject liveBar;
@ -65,6 +67,7 @@ namespace HeavenStudio.Games
//public int version;
public float lookAtLength = 1f;
//public enum VersionOfContact
//{
// FirstContact,
@ -87,9 +90,20 @@ namespace HeavenStudio.Games
private void Awake()
{
instance = this;
translator.Init();
}
public void SetIntervalStart(float beat, float interval = 4f)
{
if (!intervalStarted)
{
//alienSpeakCount = 0;
//translatorSpeakCount = 0;
intervalStarted = true;
}
//intervalStartBeat = beat;
beatInterval = interval;
}
private void Update()
{
@ -102,6 +116,19 @@ namespace HeavenStudio.Games
{
lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats);
}
if (PlayerInput.Pressed() && !IsExpectingInputNow() && !noHitOnce && !isSpeaking)
{
Jukebox.PlayOneShotGame("firstContact/" + randomizerLines());
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { translator.GetComponent<Animator>().Play("translator_speak", 0, 0);}),
});
}
if ((PlayerInput.Pressed() && !IsExpectingInputNow() && isSpeaking))
{
hasMissed = true;
}
}
//public void versionOfFirstContact(int type)
@ -133,15 +160,15 @@ namespace HeavenStudio.Games
}
public void alienSpeak(float beat)
public void alienSpeak(float beat, float pitch)
{
//if (!intervalStarted)
//{
// SetIntervalStart(beat, beatInterval);
//}
//missionControl.SetActive(false);
Jukebox.PlayOneShotGame("firstContact/alien");
Jukebox.PlayOneShotGame("firstContact/alien", beat, pitch);
++alienSpeakCount;
var random = Random.Range(0, 2);
string textToPut = "";
if(random == 0)
@ -153,24 +180,32 @@ namespace HeavenStudio.Games
textToPut = "translator_lookAtAlien_nod";
}
ScheduleInput(beat, beatInterval, InputType.STANDARD_DOWN, alienTapping, alienOnMiss, AlienEmpty);
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play("alien_talk", 0, 0); }),
new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play(textToPut, 0, 0); }),
new BeatAction.Action(beat, delegate
{
if (!isSpeaking)
{
translator.GetComponent<Animator>().Play(textToPut, 0, 0);
}
}),
});
AlienFirstContact a = Instantiate(alienSpeech, dummyHolder.transform).GetComponent<AlienFirstContact>();
a.GetComponent<AlienFirstContact>().createBeat = beat;
alienSpeakCount++;
}
public void alienTurnOver(float beat)
{
//if (!intervalStarted)
//{
// SetIntervalStart(beat, beatInterval);
//}
if (!intervalStarted)
{
SetIntervalStart(beat, beatInterval);
}
if (intervalStarted)
{
SetIntervalStart(beat, beatInterval);
}
Jukebox.PlayOneShotGame("firstContact/turnover");
@ -178,27 +213,19 @@ namespace HeavenStudio.Games
{
new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play("alien_point", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play("alien_idle", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); })
new BeatAction.Action(beat + .5f,
delegate
{
if (!isSpeaking)
{
translator.GetComponent<Animator>().Play("translator_idle", 0, 0);
}
})
});
isSpeaking = true;
}
public void SetIntervalStart(float beat, float interval = 4f)
{
if (!intervalStarted)
{
alienSpeakCount = 0;
translatorSpeakCount = 0;
intervalStarted = true;
}
//intervalStartBeat = beat;
beatInterval = interval;
}
public void alienSuccess(float beat)
{
//Make this codeblock smaller
@ -221,7 +248,7 @@ namespace HeavenStudio.Games
BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
}
else if (alienSpeakCount != translatorSpeakCount)
@ -243,7 +270,7 @@ namespace HeavenStudio.Games
BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
});
}
@ -254,20 +281,6 @@ namespace HeavenStudio.Games
noHitOnce = false;
}
public void alienNoHit()
{
if (!noHitOnce)
{
Jukebox.PlayOneShotGame("firstContact/alienNoHit");
noHitOnce = true;
}
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { alien.GetComponent<Animator>().Play("alien_noHit", 0, 0); }),
});
}
public void missionControlDisplay(float beat, bool stay)
{
missionControl.SetActive(true);
@ -306,6 +319,102 @@ namespace HeavenStudio.Games
translatorSpeakCount = 0;
isSpeaking = false;
}
public void alienTapping(PlayerActionEvent caller, float beat) //OnHit
{
if (!noHitOnce)
{
++translatorSpeakCount;
Jukebox.PlayOneShotGame("firstContact/" + randomizerLines());
isCorrect = true;
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { translator.GetComponent<Animator>().Play("translator_speak", 0, 0);}),
});
}
else if (noHitOnce)
{
Jukebox.PlayOneShotGame("firstContact/slightlyFail");
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { translator.GetComponent<Animator>().Play("translator_eh", 0, 0);}),
});
}
}
public void alienOnMiss(PlayerActionEvent caller) //OnMiss
{
if (!noHitOnce)
{
Jukebox.PlayOneShotGame("firstContact/alienNoHit");
noHitOnce = true;
}
BeatAction.New(alien, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { alien.GetComponent<Animator>().Play("alien_noHit", 0, 0); }),
});
}
public void AlienEmpty(PlayerActionEvent caller) //OnEmpty
{
//empty
}
public int randomizerLines()
{
return Random.Range(1, 11);
}
//public void alienSuccessTest(PlayerActionEvent caller, float beat)
//{
// string[] sfxStrings = { "", "" };
// string animString = "";
// float off = 0f;
// if (alienSpeakCount == translatorSpeakCount)
// {
// sfxStrings[0] = "firstContact/success_1";
// sfxStrings[1] = "firstContact/success_2";
// animString = "alien_success";
// off = .15f;
// }
// else if(alienSpeakCount != translatorSpeakCount)
// {
// sfxStrings[0] = "firstContact/failAlien_1";
// sfxStrings[1] = "firstContact/failAlien_2";
// animString = "alien_fail";
// off = .5f;
// }
// string[] sounds = new string[] { sfxStrings[0], sfxStrings[0] };
// var sound = new MultiSound.Sound[]
// {
// new MultiSound.Sound(sounds[0], beat),
// new MultiSound.Sound(sounds[1], beat + .5f, offset: off)
// };
// MultiSound.Play(sound);
// BeatAction.New(alien, new List<BeatAction.Action>()
// {
// new BeatAction.Action(beat, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); }),
// new BeatAction.Action(beat + .5f, delegate { alien.GetComponent<Animator>().Play(animString, 0, 0); })
// });
// BeatAction.New(translator.gameObject, new List<BeatAction.Action>()
// {
// new BeatAction.Action(beat, delegate { translator.GetComponent<Animator>().Play("translator_idle", 0, 0); }),
// });
// alienSpeakCount = 0;
// translatorSpeakCount = 0;
// isSpeaking = false;
// hasMissed = false;
// noHitOnce = false;
//}
}
}

View file

@ -1,70 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using HeavenStudio.Util;
using Starpelly;
namespace HeavenStudio.Games.Scripts_FirstContact
{
public class Translator : PlayerActionObject
{
public Animator anim;
FirstContact game;
public void Init()
{
game = FirstContact.instance;
//anim = GetComponent<Animator>();
}
private void Update()
{
////IF YOU WANT TO PLAY NOTES ANYTIME W/O CONSTRAINTS
//if (PlayerInput.Pressed(true) && !game.isSpeaking)
//{
// successTranslation(true);
//}
}
public void successTranslation(bool ace)
{
if (ace)
{
//if(game.version == 1)
//{
// Jukebox.PlayOneShotGame("firstContact/citrusRemix/1_r");
//}
Jukebox.PlayOneShotGame("firstContact/" + randomizerLines());
}
else
{
Jukebox.PlayOneShotGame("firstContact/failContact");
}
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_speak", 0, 0);}),
});
}
public void ehTranslation()
{
Jukebox.PlayOneShotGame("firstContact/slightlyFail");
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_eh", 0, 0);}),
});
}
public int randomizerLines()
{
return Random.Range(1, 11);
}
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 090e2309a1a03314d93714e9c1ed5a99
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -23,7 +23,7 @@ public class WhiteLines : MonoBehaviour
}
}
void Update()
void FixedUpdate()
{
if(transform.position.y > endAt && !isRandomLineMiddle)
{

View file

@ -1,5 +1,5 @@
ManifestFileVersion: 0
CRC: 3049528508
CRC: 1137954711
AssetBundleManifest:
AssetBundleInfos:
Info_0:

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0
CRC: 2012087739
CRC: 4200721013
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 8b334bb89c2bd50abd515949ade25271
Hash: 996e27defaede200a0288a246ceb7785
TypeTreeHash:
serializedVersion: 2
Hash: 77ce82dcd01e7c9c803f77daf119d967

Binary file not shown.

View file

@ -1,12 +1,12 @@
ManifestFileVersion: 0
CRC: 1677829072
CRC: 3294649116
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 7f4370cd33967373a820e37c2122eed7
Hash: dd0c19304cf6445216469a6916c9e238
TypeTreeHash:
serializedVersion: 2
Hash: 72318499ea6097cc1940540bf07331d9
Hash: 902c722d69f548f2a42d6263cb334ee9
HashAppended: 0
ClassTypes:
- Class: 1

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0
CRC: 2010253220
CRC: 47493552
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 3e555585e70be6acd65ba10c73ef4544
Hash: 277abe6be554c0a5a8b3115a4b8317aa
TypeTreeHash:
serializedVersion: 2
Hash: d5bdda7523be8cdc2ec1df479dc7821d