Added First Rendition of Balls

This commit is contained in:
Rapandrasmus 2023-01-14 22:06:34 +01:00
parent 97618be7f3
commit f42f2aeab7
8 changed files with 706 additions and 457 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,109 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6968929825102689508
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9118664775683828045}
- component: {fileID: 8975074000070167335}
- component: {fileID: 3069789971604295600}
m_Layer: 0
m_Name: Big_Ball
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &9118664775683828045
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6968929825102689508}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -2.25, y: 1.23, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &8975074000070167335
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6968929825102689508}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
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: -1
m_Sprite: {fileID: -7404805908248315402, guid: 7bc82af4cf328374596aff0ade3ad198, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.54, y: 0.54}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &3069789971604295600
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6968929825102689508}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f589a35cd43c5a146b78729182754157, type: 3}
m_Name:
m_EditorClassIdentifier:
inList: 0
state:
gameObject: {fileID: 0}
early: 0
perfect: 0
late: 0
createBeat: 0
eligibleHitsList: []
aceTimes: 0
isEligible: 0
triggersAutoplay: 1
startBeat: 0

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a2e29e987c9ff254fa0bdd4691118c08
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,109 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &382570604032400431
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8208652835764615224}
- component: {fileID: 4806736121672646648}
- component: {fileID: 4347410504349864029}
m_Layer: 0
m_Name: Small_Ball
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &8208652835764615224
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 382570604032400431}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.43, y: 0.45, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &4806736121672646648
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 382570604032400431}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
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: -1
m_Sprite: {fileID: 7027999062844758930, guid: 7bc82af4cf328374596aff0ade3ad198, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.54, y: 0.54}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &4347410504349864029
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 382570604032400431}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f589a35cd43c5a146b78729182754157, type: 3}
m_Name:
m_EditorClassIdentifier:
inList: 0
state:
gameObject: {fileID: 0}
early: 0
perfect: 0
late: 0
createBeat: 0
eligibleHitsList: []
aceTimes: 0
isEligible: 0
triggersAutoplay: 1
startBeat: 0

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5e70efa504ce792438a6ad71a4b465a7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -83,6 +83,12 @@ TextureImporter:
- first:
213: 8361081418149950792
second: Impact
- first:
213: -7404805908248315402
second: Big_Ball
- first:
213: 7027999062844758930
second: Small_Ball
externalObjects: {}
serializedVersion: 11
mipmaps:
@ -726,7 +732,7 @@ TextureImporter:
width: 62
height: 62
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@ -738,6 +744,48 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: Big_Ball
rect:
serializedVersion: 2
x: 969
y: 777
width: 54
height: 54
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 6f935204248dc3990800000000000000
internalID: -7404805908248315402
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Small_Ball
rect:
serializedVersion: 2
x: 969
y: 833
width: 54
height: 54
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 29bd3a669e7788160800000000000000
internalID: 7027999062844758930
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []

View file

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -8,11 +9,62 @@ namespace HeavenStudio.Games.Scripts_WorkingDough
{
public class NPCDoughBall : PlayerActionObject
{
public float startBeat;
//public bool isBig;
public enum FlyingStage
{
EnteringUp,
EnteringDown,
ExitingUp,
ExitingDown
}
FlyingStage currentFlyingStage = FlyingStage.EnteringUp;
[NonSerialized] public BezierCurve3D enterUpCurve;
[NonSerialized] public BezierCurve3D enterDownCurve;
[NonSerialized] public BezierCurve3D exitUpCurve;
[NonSerialized] public BezierCurve3D exitDownCurve;
private WorkingDough game;
private void Awake()
{
game = WorkingDough.instance;
}
private void Update()
{
var cond = Conductor.instance;
float flyPos = 0f;
switch (currentFlyingStage) {
case FlyingStage.EnteringUp:
flyPos = cond.GetPositionFromBeat(startBeat, 0.5f);
transform.position = enterUpCurve.GetPoint(flyPos);
if (flyPos > 1f) currentFlyingStage = FlyingStage.EnteringDown;
break;
case FlyingStage.EnteringDown:
flyPos = cond.GetPositionFromBeat(startBeat + 0.5f, 0.5f);
transform.position = enterDownCurve.GetPoint(flyPos);
if (flyPos > 1f) currentFlyingStage = FlyingStage.ExitingUp;
break;
case FlyingStage.ExitingUp:
flyPos = cond.GetPositionFromBeat(startBeat + 1f, 0.5f);
transform.position = exitUpCurve.GetPoint(flyPos);
if (flyPos > 1f) currentFlyingStage = FlyingStage.ExitingDown;
break;
case FlyingStage.ExitingDown:
flyPos = cond.GetPositionFromBeat(startBeat + 1.5f, 0.5f);
transform.position = exitDownCurve.GetPoint(flyPos);
if (flyPos > 1f) GameObject.Destroy(gameObject);
break;
}
}
}
}

View file

@ -2,6 +2,7 @@ using HeavenStudio.Util;
using System;
using System.Collections.Generic;
using UnityEngine;
using NaughtyBezierCurves;
namespace HeavenStudio.Games.Loaders
{
@ -21,12 +22,12 @@ namespace HeavenStudio.Games.Loaders
new GameAction("small ball", "Small Ball")
{
function = delegate { WorkingDough.instance.SpawnBall(eventCaller.currentEntity.beat, false); },
defaultLength = 1f,
defaultLength = 2f,
},
new GameAction("big ball", "Big Ball")
{
function = delegate { WorkingDough.instance.SpawnBall(eventCaller.currentEntity.beat, true); },
defaultLength = 1f,
defaultLength = 2f,
},
});
}
@ -47,12 +48,21 @@ namespace HeavenStudio.Games
[SerializeField] GameObject ballTransporterLeftPlayer; //Close and open animations
[SerializeField] GameObject npcImpact;
[SerializeField] GameObject playerImpact;
[SerializeField] GameObject smallBallNPC;
[SerializeField] GameObject bigBallNPC;
[SerializeField] Transform ballHolder;
[Header("Variables")]
public bool intervalStarted;
//float intervalStartBeat;
public float beatInterval = 4f;
[Header("Curves")]
public BezierCurve3D npcEnterUpCurve;
public BezierCurve3D npcEnterDownCurve;
public BezierCurve3D npcExitUpCurve;
public BezierCurve3D npcExitDownCurve;
public static WorkingDough instance;
void Awake()
@ -73,14 +83,14 @@ namespace HeavenStudio.Games
//End interval
new BeatAction.Action(beat + interval, delegate { intervalStarted = false; }),
//Close npc transporters
new BeatAction.Action(beat + interval, delegate { ballTransporterLeftNPC.GetComponent<Animator>().Play("BallTransporterLeftClose", 0, 0); }),
new BeatAction.Action(beat + interval, delegate { ballTransporterRightNPC.GetComponent<Animator>().Play("BallTransporterRightClose", 0, 0); }),
new BeatAction.Action(beat + interval + 0.5f, delegate { ballTransporterLeftNPC.GetComponent<Animator>().Play("BallTransporterLeftClose", 0, 0); }),
new BeatAction.Action(beat + interval + 0.5f, delegate { ballTransporterRightNPC.GetComponent<Animator>().Play("BallTransporterRightClose", 0, 0); }),
//Open player transporters
new BeatAction.Action(beat + interval, delegate { ballTransporterLeftPlayer.GetComponent<Animator>().Play("BallTransporterLeftOpen", 0, 0); }),
new BeatAction.Action(beat + interval, delegate { ballTransporterRightPlayer.GetComponent<Animator>().Play("BallTransporterRightOpen", 0, 0); }),
//Close player transporters
new BeatAction.Action(beat + interval * 2, delegate { ballTransporterLeftPlayer.GetComponent<Animator>().Play("BallTransporterLeftClose", 0, 0); }),
new BeatAction.Action(beat + interval * 2, delegate { ballTransporterRightPlayer.GetComponent<Animator>().Play("BallTransporterRightClose", 0, 0); }),
new BeatAction.Action(beat + interval * 2 + 0.5f, delegate { ballTransporterLeftPlayer.GetComponent<Animator>().Play("BallTransporterLeftClose", 0, 0); }),
new BeatAction.Action(beat + interval * 2 + 0.5f, delegate { ballTransporterRightPlayer.GetComponent<Animator>().Play("BallTransporterRightClose", 0, 0); }),
});
}
@ -90,14 +100,30 @@ namespace HeavenStudio.Games
public void SpawnBall(float beat, bool isBig)
{
if (!intervalStarted)
{
SetIntervalStart(beat, beatInterval);
}
var objectToSpawn = isBig ? bigBallNPC : smallBallNPC;
var spawnedBall = GameObject.Instantiate(objectToSpawn, ballHolder);
var ballComponent = spawnedBall.GetComponent<NPCDoughBall>();
ballComponent.startBeat = beat;
ballComponent.exitUpCurve = npcExitUpCurve;
ballComponent.enterUpCurve = npcEnterUpCurve;
ballComponent.exitDownCurve = npcExitDownCurve;
ballComponent.enterDownCurve = npcEnterDownCurve;
spawnedBall.SetActive(true);
BeatAction.New(doughDudesNPC, new List<BeatAction.Action>()
{
//Jump and play sound
new BeatAction.Action(beat + 0.5f, delegate { doughDudesNPC.GetComponent<Animator>().Play(isBig ? "BigDoughJump" :"SmallDoughJump", 0, 0); }),
new BeatAction.Action(beat + 0.5f, delegate { Jukebox.PlayOneShotGame(isBig ? "workingDough/NPCBigBall" : "workingDough/NPCSmallBall"); }),
new BeatAction.Action(beat + 0.5f, delegate { Jukebox.PlayOneShotGame("workingDough/SmallBall"); }),
new BeatAction.Action(beat + 0.5f, delegate { npcImpact.SetActive(true); }),
new BeatAction.Action(beat + 0.6f, delegate { npcImpact.SetActive(false); }),
new BeatAction.Action(beat + 1f, delegate { doughDudesNPC.GetComponent<Animator>().Play(isBig ? "BigDoughJump" :"SmallDoughJump", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { Jukebox.PlayOneShotGame(isBig ? "workingDough/NPCBigBall" : "workingDough/NPCSmallBall"); }),
new BeatAction.Action(beat + 1f, delegate { Jukebox.PlayOneShotGame("workingDough/SmallBall"); }),
new BeatAction.Action(beat + 1f, delegate { npcImpact.SetActive(true); }),
new BeatAction.Action(beat + 1.1f, delegate { npcImpact.SetActive(false); }),
});
}