wip
This commit is contained in:
parent
4ce989416d
commit
89c03e045c
138
Assets/Resources/Games/chameleon.prefab
Normal file
138
Assets/Resources/Games/chameleon.prefab
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &2662027512870423090
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 9061701609461501601}
|
||||||
|
- component: {fileID: 8901463518339414129}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: BG
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &9061701609461501601
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2662027512870423090}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 64, y: 40, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 5813499711186931250}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &8901463518339414129
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2662027512870423090}
|
||||||
|
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: -1000
|
||||||
|
m_Sprite: {fileID: 7482667652216324306, guid: ef2fa2a75dc283e40b9d4fe1f20dc6fb, type: 3}
|
||||||
|
m_Color: {r: 0.482, g: 0.74, b: 0.87, a: 1}
|
||||||
|
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!1 &5813499711186931251
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 5813499711186931250}
|
||||||
|
- component: {fileID: 3447377020634644195}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: chameleon
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &5813499711186931250
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5813499711186931251}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 9061701609461501601}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3447377020634644195
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5813499711186931251}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e69a1f275f5a3384a8e889b234a3e511, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
SoundSequences: []
|
||||||
|
scheduledInputs: []
|
||||||
|
baseFly: {fileID: 0}
|
||||||
|
chameleonAnim: {fileID: 0}
|
||||||
|
gradient: {fileID: 0}
|
||||||
|
bgHigh: {fileID: 0}
|
||||||
|
bgLow: {fileID: 0}
|
7
Assets/Resources/Games/chameleon.prefab.meta
Normal file
7
Assets/Resources/Games/chameleon.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4115c51236a654b4c89f27a9618f50d6
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Resources/Sprites/Games/Chameleon.meta
Normal file
8
Assets/Resources/Sprites/Games/Chameleon.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb822c3b5fd5cf340801738e543d264f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Resources/Sprites/Games/Chameleon/chameleon_bg.png
Normal file
BIN
Assets/Resources/Sprites/Games/Chameleon/chameleon_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 181 KiB |
123
Assets/Resources/Sprites/Games/Chameleon/chameleon_bg.png.meta
Normal file
123
Assets/Resources/Sprites/Games/Chameleon/chameleon_bg.png.meta
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7164746eb2a2f1e45b95df33d10449c3
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
ignoreMasterTextureLimit: 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: 2
|
||||||
|
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: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
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:
|
BIN
Assets/Resources/Sprites/Games/Chameleon/chameleon_main.png
Normal file
BIN
Assets/Resources/Sprites/Games/Chameleon/chameleon_main.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
123
Assets/Resources/Sprites/Games/Chameleon/chameleon_main.png.meta
Normal file
123
Assets/Resources/Sprites/Games/Chameleon/chameleon_main.png.meta
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 60ba33462b9e2b646968b2f5baa8386c
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
ignoreMasterTextureLimit: 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: 2
|
||||||
|
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: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
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:
|
8
Assets/Scripts/Games/Chameleon.meta
Normal file
8
Assets/Scripts/Games/Chameleon.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: da337eb792108b247ad5917f68d408f2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
204
Assets/Scripts/Games/Chameleon/Chameleon.cs
Normal file
204
Assets/Scripts/Games/Chameleon/Chameleon.cs
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using HeavenStudio.Util;
|
||||||
|
using HeavenStudio.InputSystem;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using Jukebox;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace HeavenStudio.Games.Loaders
|
||||||
|
{
|
||||||
|
using static Minigames;
|
||||||
|
public static class RvlChameleonLoader
|
||||||
|
{
|
||||||
|
public static Minigame AddGame(EventCaller eventCaller)
|
||||||
|
{
|
||||||
|
return new Minigame("chameleon", "Chameleon", "ffffff", false, false, new List<GameAction>()
|
||||||
|
{
|
||||||
|
new GameAction("far", "Far Fly")
|
||||||
|
{
|
||||||
|
function = delegate {var e = eventCaller.currentEntity; Chameleon.instance.SpawnFly(e.beat, 7, (int)Scripts_Chameleon.FlyType.Far, e["countIn"]); },
|
||||||
|
defaultLength = 8f,
|
||||||
|
parameters = new List<Param>()
|
||||||
|
{
|
||||||
|
new Param("countIn", false, "Count-In"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new GameAction("close", "Close Fly")
|
||||||
|
{
|
||||||
|
function = delegate {var e = eventCaller.currentEntity; Chameleon.instance.SpawnFly(e.beat, 7, (int)Scripts_Chameleon.FlyType.Close, e["countIn"]); },
|
||||||
|
defaultLength = 8f,
|
||||||
|
parameters = new List<Param>()
|
||||||
|
{
|
||||||
|
new Param("countIn", false, "Count-In"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new GameAction("background appearance", "Background Appearance")
|
||||||
|
{
|
||||||
|
function = delegate {
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
Chameleon.instance.BackgroundColorSet(e.beat, e.length, e["colorBG1Start"], e["colorBG1End"], e["colorBG2Start"], e["colorBG2End"], e["ease"]);
|
||||||
|
},
|
||||||
|
defaultLength = 0.5f,
|
||||||
|
resizable = true,
|
||||||
|
parameters = new List<Param>()
|
||||||
|
{
|
||||||
|
new Param("colorBG1Start", new Color(1f, 0.937f, 0.224f), "Start BG Color", "Set top-most color of the background gradient at the start of the event."),
|
||||||
|
new Param("colorBG1End", new Color(1f, 0.937f, 0.224f), "End BG Color", "Set top-most color of the background gradient at the end of the event."),
|
||||||
|
new Param("colorBG2Start", new Color(1f, 0.937f, 0.224f), "Start BG Color", "Set bottom-most color of the background gradient at the start of the event."),
|
||||||
|
new Param("colorBG2End", new Color(1f, 0.937f, 0.224f), "End BG Color", "Set bottom-most color of the background gradient at the end of the event."),
|
||||||
|
new Param("ease", Util.EasingFunction.Ease.Instant, "Ease", "Set the easing of the action."),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new List<string>() { "rvl", "normal" },
|
||||||
|
"rvlchameleon", "en",
|
||||||
|
new List<string>() {},
|
||||||
|
chronologicalSortKey: 107
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace HeavenStudio.Games
|
||||||
|
{
|
||||||
|
using Scripts_Chameleon;
|
||||||
|
public class Chameleon : Minigame
|
||||||
|
{
|
||||||
|
public Transform baseFly;
|
||||||
|
public Animator chameleonAnim;
|
||||||
|
|
||||||
|
|
||||||
|
[SerializeField] SpriteRenderer gradient;
|
||||||
|
[SerializeField] SpriteRenderer bgHigh;
|
||||||
|
[SerializeField] SpriteRenderer bgLow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private ColorEase[] colorEases = new ColorEase[2];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static Chameleon instance;
|
||||||
|
|
||||||
|
|
||||||
|
const int IAAltDownCat = IAMAXCAT;
|
||||||
|
|
||||||
|
|
||||||
|
protected static bool IA_PadAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_BatonAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetSqueezeDown(out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_TouchAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_Alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static PlayerInput.InputAction InputAction_Alt =
|
||||||
|
new("RvlChameleonAlt", new int[] { IAAltDownCat, IAAltDownCat, IAAltDownCat },
|
||||||
|
IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress);
|
||||||
|
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
instance = this;
|
||||||
|
|
||||||
|
|
||||||
|
colorEases = new ColorEase[] {
|
||||||
|
new(Color.white),
|
||||||
|
new(Color.white),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
var cond = Conductor.instance;
|
||||||
|
if (cond.isPlaying && !cond.isPaused)
|
||||||
|
{
|
||||||
|
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress))
|
||||||
|
{
|
||||||
|
{
|
||||||
|
chameleonAnim.DoScaledAnimationAsync("", 0.5f);
|
||||||
|
SoundByte.PlayOneShotGame("chameleon/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (PlayerInput.GetIsAction(InputAction_Alt) && !IsExpectingInputNow(InputAction_Alt))
|
||||||
|
{
|
||||||
|
{
|
||||||
|
chameleonAnim.DoScaledAnimationAsync("", 0.5f);
|
||||||
|
SoundByte.PlayOneShotGame("chameleon/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateBackgroundColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SpawnFly(double beat, double length, int type, bool countIn)
|
||||||
|
{
|
||||||
|
var newFly = Instantiate(baseFly, transform).GetComponent<Fly>();
|
||||||
|
newFly.startBeat = beat;
|
||||||
|
newFly.flyType = (FlyType)type;
|
||||||
|
|
||||||
|
|
||||||
|
if (countIn)
|
||||||
|
{
|
||||||
|
MultiSound.Play(new MultiSound.Sound[]{
|
||||||
|
new MultiSound.Sound("count-ins/and", beat + 2),
|
||||||
|
new MultiSound.Sound(UnityEngine.Random.Range(0.0f, 1.0f) > 0.5 ? "count-ins/go1" : "count-ins/go2", beat + 3),
|
||||||
|
}, forcePlay: true, game: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||||
|
{
|
||||||
|
new BeatAction.Action(beat, delegate {
|
||||||
|
newFly.Init();
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void BackgroundColorSet(double beat, float length, Color BG1Start, Color BG1End, Color BG2Start, Color BG2End, int colorEaseSet)
|
||||||
|
{
|
||||||
|
colorEases = new ColorEase[] {
|
||||||
|
new(beat, length, BG1Start, BG1End, colorEaseSet),
|
||||||
|
new(beat, length, BG2Start, BG2End, colorEaseSet),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
UpdateBackgroundColor();
|
||||||
|
}
|
||||||
|
private void UpdateBackgroundColor()
|
||||||
|
{
|
||||||
|
gradient.color = colorEases[0].GetColor();
|
||||||
|
bgHigh.color = colorEases[0].GetColor();
|
||||||
|
bgLow.color = colorEases[1].GetColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Games/Chameleon/Chameleon.cs.meta
Normal file
11
Assets/Scripts/Games/Chameleon/Chameleon.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e69a1f275f5a3384a8e889b234a3e511
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
171
Assets/Scripts/Games/Chameleon/Fly.cs
Normal file
171
Assets/Scripts/Games/Chameleon/Fly.cs
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
|
using HeavenStudio.Util;
|
||||||
|
|
||||||
|
|
||||||
|
namespace HeavenStudio.Games.Scripts_Chameleon
|
||||||
|
{
|
||||||
|
public enum FlyType
|
||||||
|
{
|
||||||
|
Far,
|
||||||
|
Close,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class Fly : MonoBehaviour
|
||||||
|
{
|
||||||
|
public double startBeat;
|
||||||
|
public FlyType flyType;
|
||||||
|
[SerializeField] private Animator flyAnim;
|
||||||
|
|
||||||
|
|
||||||
|
private Sound loopSound;
|
||||||
|
|
||||||
|
|
||||||
|
bool isPresent, isAction;
|
||||||
|
|
||||||
|
|
||||||
|
private Chameleon game;
|
||||||
|
|
||||||
|
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
game = Chameleon.instance;
|
||||||
|
|
||||||
|
|
||||||
|
string typePrefix = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => "Far",
|
||||||
|
FlyType.Close => "Close",
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
loopSound = SoundByte.PlayOneShotGame("chameleon/", -1, 1, 1, true);
|
||||||
|
MultiSound.Play(
|
||||||
|
new MultiSound.Sound[] {
|
||||||
|
new MultiSound.Sound("chameleon/", startBeat + 4),
|
||||||
|
new MultiSound.Sound("chameleon/", startBeat + 5),
|
||||||
|
new MultiSound.Sound("chameleon/", startBeat + 6),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
BeatAction.New(this, new List<BeatAction.Action>()
|
||||||
|
{
|
||||||
|
new BeatAction.Action(startBeat, delegate {
|
||||||
|
flyAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
loopSoundRelease();
|
||||||
|
}),
|
||||||
|
new BeatAction.Action(startBeat + 4, delegate {
|
||||||
|
flyAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
loopSoundRelease();
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var InputAction = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => Chameleon.InputAction_Alt,
|
||||||
|
FlyType.Close => Chameleon.InputAction_BasicPress,
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
game.ScheduleInput(startBeat + 4, 4, InputAction, JustCatch, MissCatch, Empty, CanCatch);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
var cond = Conductor.instance;
|
||||||
|
if (cond.isPlaying && !cond.isPaused)
|
||||||
|
{
|
||||||
|
if (PlayerInput.GetIsAction(Chameleon.InputAction_BasicPress) && !game.IsExpectingInputNow(Chameleon.InputAction_BasicPress))
|
||||||
|
{
|
||||||
|
if (!isAction && isPresent && flyType is FlyType.Close)
|
||||||
|
{
|
||||||
|
isPresent = false;
|
||||||
|
string typePrefix = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => "Far",
|
||||||
|
FlyType.Close => "Close",
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
SoundByte.PlayOneShotGame("chameleon/" + typePrefix);
|
||||||
|
flyAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (PlayerInput.GetIsAction(Chameleon.InputAction_Alt) && !game.IsExpectingInputNow(Chameleon.InputAction_Alt))
|
||||||
|
{
|
||||||
|
if (!isAction && isPresent)
|
||||||
|
{
|
||||||
|
isPresent = false;
|
||||||
|
string typePrefix = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => "Far",
|
||||||
|
FlyType.Close => "Close",
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
SoundByte.PlayOneShotGame("chameleon/" + typePrefix);
|
||||||
|
flyAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JustCatch(PlayerActionEvent caller, float state)
|
||||||
|
{
|
||||||
|
isAction = true;
|
||||||
|
|
||||||
|
string typePrefix = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => "Far",
|
||||||
|
FlyType.Close => "Close",
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
game.chameleonAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
if (state <= -1f || state >= 1f)
|
||||||
|
{
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MissCatch(PlayerActionEvent caller)
|
||||||
|
{
|
||||||
|
isAction = true;
|
||||||
|
|
||||||
|
|
||||||
|
string typePrefix = flyType switch
|
||||||
|
{
|
||||||
|
FlyType.Far => "Far",
|
||||||
|
FlyType.Close => "Close",
|
||||||
|
_ => throw new System.NotImplementedException()
|
||||||
|
};
|
||||||
|
game.chameleonAnim.DoScaledAnimationAsync("" + typePrefix, 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CanCatch() { return isPresent;}
|
||||||
|
|
||||||
|
|
||||||
|
void Empty(PlayerActionEvent caller) { }
|
||||||
|
|
||||||
|
|
||||||
|
private void loopSoundRelease()
|
||||||
|
{
|
||||||
|
if (loopSound != null)
|
||||||
|
{
|
||||||
|
loopSound.KillLoop(0);
|
||||||
|
loopSound = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Games/Chameleon/Fly.cs.meta
Normal file
11
Assets/Scripts/Games/Chameleon/Fly.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3c9a2a52c2f6539469d21046c1320b64
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -113,6 +113,16 @@ namespace HeavenStudio
|
||||||
Debug.LogWarning("Game loader CtrCatchLoader failed!");
|
Debug.LogWarning("Game loader CtrCatchLoader failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
game = RvlChameleonLoader.AddGame(eventCaller);
|
||||||
|
if (game != null)
|
||||||
|
{
|
||||||
|
eventCaller.minigames.Add(game.name, game);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Game loader RvlChameleonLoader failed!");
|
||||||
|
}
|
||||||
|
|
||||||
game = CtrChargingChickenLoader.AddGame(eventCaller);
|
game = CtrChargingChickenLoader.AddGame(eventCaller);
|
||||||
if (game != null)
|
if (game != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue