Merge branch 'master' into more-ntrIdol-2

This commit is contained in:
minenice55 2022-03-28 09:43:55 -04:00
commit 24765c3d68
51 changed files with 5542 additions and 104 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9e7c0c6ded5b75143bdf0d9825865eb5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,80 @@
%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: BlueBearCrumb
m_Shader: {fileID: 4800000, guid: f8af2663bd6590d48bd968ceba6cf28d, 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:
- PixelSnap: 0
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 0.3529412, g: 0.5137255, b: 0.70980394, a: 1}
m_BuildTextureStacks: []

View file

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

View file

@ -0,0 +1,92 @@
Shader "Sprites/BlueBearCrumb"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_OutlineColor ("Outline Color", Color) = (0,0,0,0)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Cull Off
Lighting Off
ZWrite Off
Blend One OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ PIXELSNAP_ON
#include "UnityCG.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
fixed4 _Color;
fixed4 _OutlineColor;
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
#ifdef PIXELSNAP_ON
OUT.vertex = UnityPixelSnap (OUT.vertex);
#endif
return OUT;
}
sampler2D _MainTex;
sampler2D _AlphaTex;
float _AlphaSplitEnabled;
fixed4 SampleSpriteTexture (float2 uv)
{
fixed4 color = tex2D (_MainTex, uv);
#if UNITY_TEXTURE_ALPHASPLIT_ALLOWED
if (_AlphaSplitEnabled)
color.a = tex2D (_AlphaTex, uv).r;
#endif //UNITY_TEXTURE_ALPHASPLIT_ALLOWED
return color;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed4 c = SampleSpriteTexture (IN.texcoord);
float3 outlinedRGB = lerp(IN.color.rgb, _OutlineColor.rgb, 1 - c.r);
c = fixed4(outlinedRGB.r, outlinedRGB.g, outlinedRGB.b, c.a);
c.rgb *= c.a;
return c;
}
ENDCG
}
}
}

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f8af2663bd6590d48bd968ceba6cf28d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: dc806439d4308e1448932d7c3332c1be
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,108 @@
fileFormatVersion: 2
guid: d687bebfacdf858459b003f0fe65b2d6
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
- 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
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,96 @@
fileFormatVersion: 2
guid: 85b66facaeeedb54f94e941da1015edd
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

@ -17,6 +17,9 @@ namespace HeavenStudio
// The number of seconds for each song beat // The number of seconds for each song beat
public float secPerBeat; public float secPerBeat;
// The number of seconds for each song beat, inversely scaled to song pitch (higer pitch = shorter time)
public float pitchedSecPerBeat => (secPerBeat / musicSource.pitch);
// Current song position, in seconds // Current song position, in seconds
private float songPos; // for Conductor use only private float songPos; // for Conductor use only
public float songPosition; public float songPosition;
@ -237,7 +240,7 @@ namespace HeavenStudio
// convert real seconds to beats // convert real seconds to beats
public float GetRestFromRealTime(float seconds) public float GetRestFromRealTime(float seconds)
{ {
return seconds/secPerBeat; return seconds/pitchedSecPerBeat;
} }
public void SetBpm(float bpm) public void SetBpm(float bpm)

View file

@ -19,13 +19,19 @@ namespace HeavenStudio.Games
[Header("References")] [Header("References")]
public GameObject donutBase; public GameObject donutBase;
public GameObject cakeBase; public GameObject cakeBase;
public GameObject crumbsBase;
public Transform foodHolder; public Transform foodHolder;
public Transform crumbsHolder;
public GameObject individualBagHolder; public GameObject individualBagHolder;
[Header("Curves")] [Header("Curves")]
public BezierCurve3D donutCurve; public BezierCurve3D donutCurve;
public BezierCurve3D cakeCurve; public BezierCurve3D cakeCurve;
[Header("Gradients")]
public Gradient donutGradient;
public Gradient cakeGradient;
private bool squashing; private bool squashing;
public static BlueBear instance; public static BlueBear instance;

View file

@ -61,7 +61,8 @@ namespace HeavenStudio.Games.Scripts_BlueBear
Jukebox.PlayOneShotGame("blueBear/chompDonut"); Jukebox.PlayOneShotGame("blueBear/chompDonut");
// Placeholder! Show particles here! SpawnCrumbs();
GameObject.Destroy(gameObject); GameObject.Destroy(gameObject);
} }
} }
@ -76,7 +77,8 @@ namespace HeavenStudio.Games.Scripts_BlueBear
Jukebox.PlayOneShotGame("blueBear/chompCake"); Jukebox.PlayOneShotGame("blueBear/chompCake");
// Placeholder! Show particles here! SpawnCrumbs();
GameObject.Destroy(gameObject); GameObject.Destroy(gameObject);
} }
} }
@ -99,8 +101,23 @@ namespace HeavenStudio.Games.Scripts_BlueBear
Jukebox.PlayOneShotGame("blueBear/chompDonut"); Jukebox.PlayOneShotGame("blueBear/chompDonut");
} }
// Placeholder! Show particles here! SpawnCrumbs();
GameObject.Destroy(gameObject); GameObject.Destroy(gameObject);
} }
void SpawnCrumbs()
{
var crumbsGO = GameObject.Instantiate(game.crumbsBase, game.crumbsHolder);
crumbsGO.SetActive(true);
crumbsGO.transform.position = transform.position;
var ps = crumbsGO.GetComponent<ParticleSystem>();
var main = ps.main;
var newGradient = new ParticleSystem.MinMaxGradient(isCake ? game.cakeGradient : game.donutGradient);
newGradient.mode = ParticleSystemGradientMode.RandomColor;
main.startColor = newGradient;
ps.Play();
}
} }
} }

View file

@ -48,13 +48,8 @@ namespace HeavenStudio.Games
environmentMaterials = environmentRenderer.materials; environmentMaterials = environmentRenderer.materials;
beltMaterial = Instantiate(environmentMaterials[8]); beltMaterial = Instantiate(environmentMaterials[8]);
environmentMaterials[8] = beltMaterial; environmentMaterials[8] = beltMaterial;
}
void Start()
{
renderQuadTrans.gameObject.SetActive(true); renderQuadTrans.gameObject.SetActive(true);
var cam = GameCamera.instance.camera; var cam = GameCamera.instance.camera;
var camHeight = 2f * cam.orthographicSize; var camHeight = 2f * cam.orthographicSize;
var camWidth = camHeight * cam.aspect; var camWidth = camHeight * cam.aspect;

View file

@ -30,9 +30,10 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
InitLions();
} }
private void Start() private void InitLions()
{ {
float startPos = -3.066667f; float startPos = -3.066667f;
float maxWidth = 12.266668f; float maxWidth = 12.266668f;
@ -53,6 +54,7 @@ namespace HeavenStudio.Games
if (i == lionCount - 1) if (i == lionCount - 1)
ClappyTrioPlayer = lion.AddComponent<ClappyTrioPlayer>(); ClappyTrioPlayer = lion.AddComponent<ClappyTrioPlayer>();
} }
} }
private void Update() private void Update()
@ -161,7 +163,7 @@ namespace HeavenStudio.Games
Lion.RemoveRange(1, lionCount - 1); Lion.RemoveRange(1, lionCount - 1);
lionCount = lions; lionCount = lions;
SetFace(0, 0); SetFace(0, 0);
Start(); InitLions();
PlayAnimationAll("Idle"); PlayAnimationAll("Idle");
} }

View file

@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio
private GameObject clapEffect; private GameObject clapEffect;
new int aceTimes = 0; new int aceTimes = 0;
private void Start() private void Awake()
{ {
clapEffect = transform.GetChild(4).GetChild(3).gameObject; clapEffect = transform.GetChild(4).GetChild(3).gameObject;
} }

View file

@ -14,7 +14,7 @@ namespace HeavenStudio.Games
const float stepDistance = 2.115f; const float stepDistance = 2.115f;
public static float[] moleSoundOffsets = new float[]{ 0.134f, 0.05f, 0.061f }; public static float[] moleSoundOffsets = new float[]{ 0.134f, 0.05f, 0.061f };
float scrollRate => stepDistance / (Conductor.instance.secPerBeat * 2f / Conductor.instance.musicSource.pitch); float scrollRate => stepDistance / (Conductor.instance.pitchedSecPerBeat * 2f);
float grassWidth; float grassWidth;
float dotsWidth = 19.2f; float dotsWidth = 19.2f;
@ -51,12 +51,8 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;// Finding grass sprite width for grass scrolling.
} farmer.Init();
private void Start()
{
// Finding grass sprite width for grass scrolling.
var grassSprite = grass.sprite; var grassSprite = grass.sprite;
var borderLeft = grassSprite.rect.xMin + grassSprite.border.x; var borderLeft = grassSprite.rect.xMin + grassSprite.border.x;
var borderRight = grassSprite.rect.xMax - grassSprite.border.z; var borderRight = grassSprite.rect.xMax - grassSprite.border.z;
@ -295,7 +291,7 @@ namespace HeavenStudio.Games
var veggieX = (beat - startBeat) * -stepDistance / 2f; var veggieX = (beat - startBeat) * -stepDistance / 2f;
newVeggie.transform.localPosition = new Vector3(veggieX, 0f, 0f); newVeggie.transform.localPosition = new Vector3(veggieX, 0f, 0f);
newVeggie.Init();
newVeggie.gameObject.SetActive(true); newVeggie.gameObject.SetActive(true);
} }

View file

@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
private CropStomp game; private CropStomp game;
private void Start() public void Init()
{ {
game = CropStomp.instance; game = CropStomp.instance;
} }

View file

@ -33,7 +33,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
private CropStomp game; private CropStomp game;
private void Start() public void Init()
{ {
game = CropStomp.instance; game = CropStomp.instance;
@ -231,7 +231,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
var veggieScale = veggieTrans.localScale; var veggieScale = veggieTrans.localScale;
veggieTrans.localScale = new Vector3(veggieScale.x * 0.5f, veggieScale.y, veggieScale.z); veggieTrans.localScale = new Vector3(veggieScale.x * 0.5f, veggieScale.y, veggieScale.z);
squashTween = veggieTrans.DOScaleX(veggieScale.x, cond.secPerBeat * 0.5f / cond.musicSource.pitch); squashTween = veggieTrans.DOScaleX(veggieScale.x, cond.pitchedSecPerBeat * 0.5f);
ResetState(); ResetState();

View file

@ -32,11 +32,8 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
djYellowAnim = djYellow.GetComponent<Animator>(); djYellowAnim = djYellow.GetComponent<Animator>();
student.Init();
} }
private void Update() private void Update()
@ -108,7 +105,7 @@ namespace HeavenStudio.Games
var sound = new MultiSound.Sound[] var sound = new MultiSound.Sound[]
{ {
new MultiSound.Sound(sounds[0], beat), new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + 1f - (0.030f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
new MultiSound.Sound("", beat + 2f) new MultiSound.Sound("", beat + 2f)
}; };
@ -136,7 +133,7 @@ namespace HeavenStudio.Games
var sound = new MultiSound.Sound[] var sound = new MultiSound.Sound[]
{ {
new MultiSound.Sound("djSchool/andStop1", beat), new MultiSound.Sound("djSchool/andStop1", beat),
new MultiSound.Sound("djSchool/andStop2", beat + .5f - (0.1200f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
new MultiSound.Sound("", beat + 1.5f) new MultiSound.Sound("", beat + 1.5f)
}; };
@ -178,8 +175,8 @@ namespace HeavenStudio.Games
new MultiSound.Sound(sounds[0], beat), new MultiSound.Sound(sounds[0], beat),
new MultiSound.Sound(sounds[1], beat + .25f), new MultiSound.Sound(sounds[1], beat + .25f),
new MultiSound.Sound(sounds[2], beat + .5f), new MultiSound.Sound(sounds[2], beat + .5f),
new MultiSound.Sound(sounds[3], beat + 1f - (0.0500f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), new MultiSound.Sound(sounds[3], beat + 1f, offset: 0.0500f),
new MultiSound.Sound(sounds[4], beat + 2f - (0.070f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), new MultiSound.Sound(sounds[4], beat + 2f, offset: 0.070f),
}); });
BeatAction.New(djYellow, new List<BeatAction.Action>() BeatAction.New(djYellow, new List<BeatAction.Action>()

View file

@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
private DJSchool game; private DJSchool game;
private void Start() public void Init()
{ {
game = DJSchool.instance; game = DJSchool.instance;
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();

View file

@ -14,7 +14,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
private bool hasHit = false; private bool hasHit = false;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Awake()
{ {
PlayerActionInit(gameObject, startBeat); PlayerActionInit(gameObject, startBeat);
} }

View file

@ -43,10 +43,10 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
SetMiis();
} }
// TODO: Move this to OnGameSwitch() when functional? public void OnGameSwitch()
private void Start()
{ {
SetMiis(); SetMiis();
} }

View file

@ -102,14 +102,16 @@ namespace HeavenStudio.Games
for (int i = 0; i < FAN_COUNT; i++) for (int i = 0; i < FAN_COUNT; i++)
{ {
GameObject mobj = Instantiate(spectator, spectatorAnchor.transform.parent); GameObject mobj = Instantiate(spectator, spectatorAnchor.transform.parent);
NtrIdolFan fan = mobj.GetComponent<NtrIdolFan>();
mobj.transform.localPosition = new Vector3(spawnPos.x, spawnPos.y, spawnPos.z); mobj.transform.localPosition = new Vector3(spawnPos.x, spawnPos.y, spawnPos.z);
mobj.GetComponent<SortingGroup>().sortingOrder = i + sortOrigin; mobj.GetComponent<SortingGroup>().sortingOrder = i + sortOrigin;
if (i == 3) if (i == 3)
{ {
Player = mobj.GetComponent<NtrIdolFan>(); Player = fan;
Player.player = true; Player.player = true;
} }
Spectators.Add(mobj); Spectators.Add(mobj);
fan.Init();
//prepare spawn point of next spectator //prepare spawn point of next spectator
spawnPos.x += RADIUS * 2; spawnPos.x += RADIUS * 2;
@ -127,6 +129,9 @@ namespace HeavenStudio.Games
} }
} }
const int FAN_COUNT = 12;
const float RADIUS = 1.3f;
public override void OnGameSwitch(float beat) public override void OnGameSwitch(float beat)
{ {
if (wantHais != Single.MinValue) if (wantHais != Single.MinValue)

View file

@ -36,7 +36,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
private bool inputHit = false; private bool inputHit = false;
private bool hasHit = false; private bool hasHit = false;
public void Start() public void Init()
{ {
if (player) if (player)
upcomingHits = new Queue<KeyValuePair<float, int>>(); // beat, type upcomingHits = new Queue<KeyValuePair<float, int>>(); // beat, type

View file

@ -9,7 +9,7 @@ namespace HeavenStudio.Games
public class Fireworks : Minigame public class Fireworks : Minigame
{ {
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Awake()
{ {
} }

View file

@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_Fireworks
public bool isSparkler; public bool isSparkler;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Awake()
{ {
} }

View file

@ -45,10 +45,6 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
} }

View file

@ -16,14 +16,14 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
public int type; public int type;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
// SCHEDULING zoom sound so it lines up with when it meets the fork. // SCHEDULING zoom sound so it lines up with when it meets the fork.
var currentDspTime = AudioSettings.dspTime; var currentDspTime = AudioSettings.dspTime;
var cond = Conductor.instance; var cond = Conductor.instance;
var zoomStartTime = currentDspTime + (double)(cond.secPerBeat * 2 / cond.musicSource.pitch) - 0.317; var zoomStartTime = currentDspTime + (double)(cond.pitchedSecPerBeat * 2) - 0.317;
Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime); Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime);
GetComponentInChildren<SpriteRenderer>().sprite = ForkLifter.instance.peaSprites[type]; GetComponentInChildren<SpriteRenderer>().sprite = ForkLifter.instance.peaSprites[type];

View file

@ -24,7 +24,7 @@ namespace HeavenStudio.Games.Global
private List<Beatmap.Entity> allFadeEvents = new List<Beatmap.Entity>(); private List<Beatmap.Entity> allFadeEvents = new List<Beatmap.Entity>();
private void Start() private void Awake()
{ {
this.gameObject.transform.SetParent(GameManager.instance.gameObject.transform); this.gameObject.transform.SetParent(GameManager.instance.gameObject.transform);
gameObject.layer = LayerMask.NameToLayer("Flash"); gameObject.layer = LayerMask.NameToLayer("Flash");

View file

@ -20,7 +20,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public GameObject shadow; public GameObject shadow;
private void Start() private void Awake()
{ {
SpriteRenderer = this.gameObject.GetComponent<SpriteRenderer>(); SpriteRenderer = this.gameObject.GetComponent<SpriteRenderer>();
SpriteRenderer.sprite = KarateMan.instance.BarrelSprites[spriteIndex]; SpriteRenderer.sprite = KarateMan.instance.BarrelSprites[spriteIndex];

View file

@ -29,7 +29,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
[SerializeField] private AnimationCurve outCurve; [SerializeField] private AnimationCurve outCurve;
[SerializeField] private AnimationCurve shadowHitCurve; [SerializeField] private AnimationCurve shadowHitCurve;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();

View file

@ -17,7 +17,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public GameObject pot; public GameObject pot;
private void Start() private void Awake()
{ {
SpriteRenderer sr = gameObject.AddComponent<SpriteRenderer>(); SpriteRenderer sr = gameObject.AddComponent<SpriteRenderer>();
sr.sprite = KarateMan.instance.CookingPotSprites[1]; sr.sprite = KarateMan.instance.CookingPotSprites[1];

View file

@ -56,7 +56,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
private int missTimes = 0; private int missTimes = 0;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
spriteComp = Sprite.GetComponent<SpriteRenderer>(); spriteComp = Sprite.GetComponent<SpriteRenderer>();

View file

@ -30,10 +30,6 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
canGo = false; canGo = false;
man.stepTimes = 0; man.stepTimes = 0;
SetInterval(0); SetInterval(0);

View file

@ -14,7 +14,7 @@ namespace HeavenStudio.Games.Scripts_MrUpbeat
private bool passedFirst = false; private bool passedFirst = false;
public float beatOffset = 0; public float beatOffset = 0;
private void Start() private void Awake()
{ {
PlayerActionInit(gameObject, startBeat); PlayerActionInit(gameObject, startBeat);
} }

View file

@ -15,7 +15,7 @@ namespace HeavenStudio.Games.Scripts_RhythmRally
private Animator opponentAnim; private Animator opponentAnim;
private Conductor cond; private Conductor cond;
void Awake() public void Init()
{ {
game = RhythmRally.instance; game = RhythmRally.instance;
playerAnim = game.playerAnim; playerAnim = game.playerAnim;

View file

@ -55,13 +55,9 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
} paddlers.Init();
void Start()
{
renderQuadTrans.gameObject.SetActive(true); renderQuadTrans.gameObject.SetActive(true);
var cam = GameCamera.instance.camera; var cam = GameCamera.instance.camera;
var camHeight = 2f * cam.orthographicSize; var camHeight = 2f * cam.orthographicSize;
var camWidth = camHeight * cam.aspect; var camWidth = camHeight * cam.aspect;

View file

@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
public SpriteRenderer heldHairSprite; public SpriteRenderer heldHairSprite;
public Transform tweezerSpriteTrans; public Transform tweezerSpriteTrans;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
vegetableAnim = RhythmTweezers.instance.VegetableAnimator; vegetableAnim = RhythmTweezers.instance.VegetableAnimator;

View file

@ -168,6 +168,11 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
{ {
switch (state) //handle animations switch (state) //handle animations
{ {
case State.None: //the only time any ball should ever have this state is if it's the unused offscreen ball (which is the only reason this state exists)
{
gameObject.SetActive(false);
break;
}
case State.Dispensing: case State.Dispensing:
{ {
float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, 2.35f); float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, 2.35f);

View file

@ -20,22 +20,10 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
[Header("Components")] [Header("Components")]
private Animator anim; private Animator anim;
public Ball ball; public Ball ball;
public Transform rightLeg;
public Transform leftLeg;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
GameObject rightLeg = new GameObject();
rightLeg.transform.SetParent(this.transform);
rightLeg.transform.position = new Vector3(-0.67f, -1.48f);
GameObject leftLeg = new GameObject("leftLeg");
leftLeg.transform.SetParent(this.transform);
leftLeg.transform.position = new Vector3(0f, -1.48f);
this.rightLeg = rightLeg.transform;
this.leftLeg = leftLeg.transform;
} }
public override void OnAce() public override void OnAce()

View file

@ -24,10 +24,6 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
/*for (int x = 0; x < Random.Range(9, 12); x++) /*for (int x = 0; x < Random.Range(9, 12); x++)
{ {
for (int y = 0; y < Random.Range(6, 9); y++) for (int y = 0; y < Random.Range(6, 9); y++)

View file

@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball
private float showBeat = 0; private float showBeat = 0;
private bool isShowing = false; private bool isShowing = false;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
anim.Play("AlienIdle", 0, 0); anim.Play("AlienIdle", 0, 0);

View file

@ -57,10 +57,6 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
var camEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "camera" }); var camEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "camera" });
List<Beatmap.Entity> tempEvents = new List<Beatmap.Entity>(); List<Beatmap.Entity> tempEvents = new List<Beatmap.Entity>();
for (int i = 0; i < camEvents.Count; i++) for (int i = 0; i < camEvents.Count; i++)

View file

@ -26,7 +26,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball
public float hitRot; public float hitRot;
public float randomEndPosX; public float randomEndPosX;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();

View file

@ -29,10 +29,6 @@ namespace HeavenStudio.Games.Scripts_Spaceball
private void Awake() private void Awake()
{ {
instance = this; instance = this;
}
private void Start()
{
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
} }

View file

@ -11,9 +11,8 @@ namespace HeavenStudio.Games.Scripts_TapTrial
public float startBeat; public float startBeat;
public int type; public int type;
// Start is called before the first frame update void Awake()
void Start()
{ {
PlayerActionInit(this.gameObject, startBeat); PlayerActionInit(this.gameObject, startBeat);
} }

View file

@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_TapTrial
public float nextBeat; public float nextBeat;
public int tripleOffset = 0; public int tripleOffset = 0;
private void Start() private void Awake()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
} }

View file

@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz
public SpriteRenderer spriteRenderer; public SpriteRenderer spriteRenderer;
public GameObject shimmer; public GameObject shimmer;
public void Start() public void Awake()
{ {
int order = (int)Math.Round((transform.position.z - 2) * 1000); int order = (int)Math.Round((transform.position.z - 2) * 1000);
spriteRenderer.sortingOrder = order; spriteRenderer.sortingOrder = order;

View file

@ -20,10 +20,6 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz
private void Awake() private void Awake()
{ {
game = WizardsWaltz.instance; game = WizardsWaltz.instance;
}
private void Start()
{
spriteRenderer.sortingOrder = order; spriteRenderer.sortingOrder = order;
animator.Play("Appear", 0, 0); animator.Play("Appear", 0, 0);
} }

View file

@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz
private WizardsWaltz game; private WizardsWaltz game;
private float songPos; private float songPos;
private void Awake() public void Init()
{ {
game = WizardsWaltz.instance; game = WizardsWaltz.instance;
} }

View file

@ -34,6 +34,7 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
wizard.Init();
} }
private void Start() private void Start()