From ebeea121ed437b0f5631c70a882f88774dc12992 Mon Sep 17 00:00:00 2001 From: Slaith <34562469+Slaith12@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:08:46 -0700 Subject: [PATCH] Moved all minigame initialization to Awake() I just moved everything that was in start to awake. There are a few other changes I made, like using init functions rather than awake in scripts that depended on something that was initialized in another script's awake (to make sure things always happen in the right order), as well as some other stuff in some specific minigames --- Assets/Scripts/Games/BlueBear/BlueBear.cs | 4 ---- .../Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs | 7 +------ Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs | 5 +++-- .../Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs | 2 +- Assets/Scripts/Games/CropStomp/CropStomp.cs | 10 +++------- Assets/Scripts/Games/CropStomp/Farmer.cs | 2 +- Assets/Scripts/Games/CropStomp/Veggie.cs | 2 +- Assets/Scripts/Games/DJSchool/DJSchool.cs | 5 +---- Assets/Scripts/Games/DJSchool/Student.cs | 2 +- .../Scripts/Games/DrummingPractice/DrummerHit.cs | 2 +- .../Games/DrummingPractice/DrummingPractice.cs | 6 +++--- Assets/Scripts/Games/FanClub/FanClub.cs | 12 ++++++------ Assets/Scripts/Games/FanClub/NtrIdolFan.cs | 2 +- Assets/Scripts/Games/Fireworks/Fireworks.cs | 2 +- Assets/Scripts/Games/Fireworks/Rocket.cs | 2 +- .../Scripts/Games/ForkLifter/ForkLifterPlayer.cs | 4 ---- Assets/Scripts/Games/ForkLifter/Pea.cs | 2 +- Assets/Scripts/Games/Global/Flash.cs | 2 +- .../Scripts/Games/KarateMan/BarrelDestroyEffect.cs | 2 +- Assets/Scripts/Games/KarateMan/Bomb.cs | 2 +- .../Games/KarateMan/CookingPotDestroyEffect.cs | 2 +- Assets/Scripts/Games/KarateMan/Pot.cs | 2 +- Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs | 4 ---- Assets/Scripts/Games/MrUpbeat/UpbeatStep.cs | 2 +- Assets/Scripts/Games/RhythmRally/Paddlers.cs | 2 +- Assets/Scripts/Games/RhythmRally/RhythmRally.cs | 8 ++------ Assets/Scripts/Games/RhythmTweezers/Tweezers.cs | 2 +- Assets/Scripts/Games/SpaceSoccer/Ball.cs | 5 +++++ Assets/Scripts/Games/SpaceSoccer/Kicker.cs | 14 +------------- Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs | 4 ---- Assets/Scripts/Games/Spaceball/Alien.cs | 2 +- Assets/Scripts/Games/Spaceball/Spaceball.cs | 4 ---- Assets/Scripts/Games/Spaceball/SpaceballBall.cs | 2 +- Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs | 4 ---- Assets/Scripts/Games/TapTrial/Tap.cs | 5 ++--- Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs | 2 +- Assets/Scripts/Games/WizardsWaltz/MagicFX.cs | 2 +- Assets/Scripts/Games/WizardsWaltz/Plant.cs | 4 ---- Assets/Scripts/Games/WizardsWaltz/Wizard.cs | 2 +- Assets/Scripts/Games/WizardsWaltz/WizardsWaltz.cs | 1 + 40 files changed, 50 insertions(+), 100 deletions(-) diff --git a/Assets/Scripts/Games/BlueBear/BlueBear.cs b/Assets/Scripts/Games/BlueBear/BlueBear.cs index 7c5f3628..f119ff8c 100644 --- a/Assets/Scripts/Games/BlueBear/BlueBear.cs +++ b/Assets/Scripts/Games/BlueBear/BlueBear.cs @@ -33,10 +33,6 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - private void Update() - { headAndBodyAnim.SetBool("ShouldOpenMouth", foodHolder.childCount != 0); if (PlayerInput.GetAnyDirectionDown()) diff --git a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs index f1ae9cfb..1b30d166 100644 --- a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs +++ b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs @@ -48,13 +48,8 @@ namespace HeavenStudio.Games environmentMaterials = environmentRenderer.materials; beltMaterial = Instantiate(environmentMaterials[8]); environmentMaterials[8] = beltMaterial; - } - - - void Start() - { renderQuadTrans.gameObject.SetActive(true); - + var cam = GameCamera.instance.camera; var camHeight = 2f * cam.orthographicSize; var camWidth = camHeight * cam.aspect; diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs index 6635973f..f02987ed 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs @@ -32,7 +32,7 @@ namespace HeavenStudio.Games instance = this; } - private void Start() + private void InitLions() { float startPos = -3.066667f; float maxWidth = 12.266668f; @@ -53,6 +53,7 @@ namespace HeavenStudio.Games if (i == lionCount - 1) ClappyTrioPlayer = lion.AddComponent(); } + } private void Update() @@ -161,7 +162,7 @@ namespace HeavenStudio.Games Lion.RemoveRange(1, lionCount - 1); lionCount = lions; SetFace(0, 0); - Start(); + InitLions(); PlayAnimationAll("Idle"); } diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs index 2d4ac248..0b7a27b4 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs @@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio private GameObject clapEffect; new int aceTimes = 0; - private void Start() + private void Awake() { clapEffect = transform.GetChild(4).GetChild(3).gameObject; } diff --git a/Assets/Scripts/Games/CropStomp/CropStomp.cs b/Assets/Scripts/Games/CropStomp/CropStomp.cs index db859cb0..799cb4b1 100644 --- a/Assets/Scripts/Games/CropStomp/CropStomp.cs +++ b/Assets/Scripts/Games/CropStomp/CropStomp.cs @@ -51,12 +51,8 @@ namespace HeavenStudio.Games private void Awake() { - instance = this; - } - - private void Start() - { - // Finding grass sprite width for grass scrolling. + instance = this;// Finding grass sprite width for grass scrolling. + farmer.Init() var grassSprite = grass.sprite; var borderLeft = grassSprite.rect.xMin + grassSprite.border.x; var borderRight = grassSprite.rect.xMax - grassSprite.border.z; @@ -295,7 +291,7 @@ namespace HeavenStudio.Games var veggieX = (beat - startBeat) * -stepDistance / 2f; newVeggie.transform.localPosition = new Vector3(veggieX, 0f, 0f); - + newVeggie.Init(); newVeggie.gameObject.SetActive(true); } diff --git a/Assets/Scripts/Games/CropStomp/Farmer.cs b/Assets/Scripts/Games/CropStomp/Farmer.cs index 9474cf27..a8f82403 100644 --- a/Assets/Scripts/Games/CropStomp/Farmer.cs +++ b/Assets/Scripts/Games/CropStomp/Farmer.cs @@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp private CropStomp game; - private void Start() + public void Init() { game = CropStomp.instance; } diff --git a/Assets/Scripts/Games/CropStomp/Veggie.cs b/Assets/Scripts/Games/CropStomp/Veggie.cs index c5cde9fc..979779f1 100644 --- a/Assets/Scripts/Games/CropStomp/Veggie.cs +++ b/Assets/Scripts/Games/CropStomp/Veggie.cs @@ -33,7 +33,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp private CropStomp game; - private void Start() + public void Init() { game = CropStomp.instance; diff --git a/Assets/Scripts/Games/DJSchool/DJSchool.cs b/Assets/Scripts/Games/DJSchool/DJSchool.cs index ddc71d66..dee4ad69 100644 --- a/Assets/Scripts/Games/DJSchool/DJSchool.cs +++ b/Assets/Scripts/Games/DJSchool/DJSchool.cs @@ -32,11 +32,8 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - private void Start() - { djYellowAnim = djYellow.GetComponent(); + student.Init(); } private void Update() diff --git a/Assets/Scripts/Games/DJSchool/Student.cs b/Assets/Scripts/Games/DJSchool/Student.cs index 895b814d..0e2ed309 100644 --- a/Assets/Scripts/Games/DJSchool/Student.cs +++ b/Assets/Scripts/Games/DJSchool/Student.cs @@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool private DJSchool game; - private void Start() + public void Init() { game = DJSchool.instance; anim = GetComponent(); diff --git a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs index cbcf768d..6e5905c6 100644 --- a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs +++ b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs @@ -14,7 +14,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice private bool hasHit = false; // Start is called before the first frame update - void Start() + void Awake() { PlayerActionInit(gameObject, startBeat); } diff --git a/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs b/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs index 06946349..6df2d10e 100644 --- a/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs +++ b/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs @@ -43,10 +43,10 @@ namespace HeavenStudio.Games private void Awake() { instance = this; + SetMiis(); } - - // TODO: Move this to OnGameSwitch() when functional? - private void Start() + + public void OnGameSwitch() { SetMiis(); } diff --git a/Assets/Scripts/Games/FanClub/FanClub.cs b/Assets/Scripts/Games/FanClub/FanClub.cs index c5c43344..089335b3 100644 --- a/Assets/Scripts/Games/FanClub/FanClub.cs +++ b/Assets/Scripts/Games/FanClub/FanClub.cs @@ -62,12 +62,7 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - const int FAN_COUNT = 12; - const float RADIUS = 1.3f; - private void Start() - { Spectators = new List(); idolAnimator = Arisa.GetComponent(); @@ -86,14 +81,16 @@ namespace HeavenStudio.Games for (int i = 0; i < FAN_COUNT; i++) { GameObject mobj = Instantiate(spectator, spectatorAnchor.transform.parent); + NtrIdolFan fan = mobj.GetComponent(); mobj.transform.localPosition = new Vector3(spawnPos.x, spawnPos.y, spawnPos.z); mobj.GetComponent().sortingOrder = i + sortOrigin; if (i == 3) { - Player = mobj.GetComponent(); + Player = fan; Player.player = true; } Spectators.Add(mobj); + fan.Init(); //prepare spawn point of next spectator spawnPos.x += RADIUS * 2; @@ -111,6 +108,9 @@ namespace HeavenStudio.Games } } + const int FAN_COUNT = 12; + const float RADIUS = 1.3f; + public override void OnGameSwitch(float beat) { if (wantHais != Single.MinValue) diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index d3b24145..d01d6b76 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -36,7 +36,7 @@ namespace HeavenStudio.Games.Scripts_FanClub private bool inputHit = false; private bool hasHit = false; - public void Start() + public void Init() { if (player) upcomingHits = new Queue>(); // beat, type diff --git a/Assets/Scripts/Games/Fireworks/Fireworks.cs b/Assets/Scripts/Games/Fireworks/Fireworks.cs index a0d2dee9..8916e602 100644 --- a/Assets/Scripts/Games/Fireworks/Fireworks.cs +++ b/Assets/Scripts/Games/Fireworks/Fireworks.cs @@ -9,7 +9,7 @@ namespace HeavenStudio.Games public class Fireworks : Minigame { // Start is called before the first frame update - void Start() + void Awake() { } diff --git a/Assets/Scripts/Games/Fireworks/Rocket.cs b/Assets/Scripts/Games/Fireworks/Rocket.cs index fa86fad9..467f0feb 100644 --- a/Assets/Scripts/Games/Fireworks/Rocket.cs +++ b/Assets/Scripts/Games/Fireworks/Rocket.cs @@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_Fireworks public bool isSparkler; // Start is called before the first frame update - void Start() + void Awake() { } diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs index f31bff48..83547c45 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs @@ -45,10 +45,6 @@ namespace HeavenStudio.Games.Scripts_ForkLifter private void Awake() { instance = this; - } - - private void Start() - { anim = GetComponent(); } diff --git a/Assets/Scripts/Games/ForkLifter/Pea.cs b/Assets/Scripts/Games/ForkLifter/Pea.cs index 851a6067..f05cf896 100644 --- a/Assets/Scripts/Games/ForkLifter/Pea.cs +++ b/Assets/Scripts/Games/ForkLifter/Pea.cs @@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter public int type; - private void Start() + private void Awake() { anim = GetComponent(); diff --git a/Assets/Scripts/Games/Global/Flash.cs b/Assets/Scripts/Games/Global/Flash.cs index 932e55fd..5557d054 100644 --- a/Assets/Scripts/Games/Global/Flash.cs +++ b/Assets/Scripts/Games/Global/Flash.cs @@ -24,7 +24,7 @@ namespace HeavenStudio.Games.Global private List allFadeEvents = new List(); - private void Start() + private void Awake() { this.gameObject.transform.SetParent(GameManager.instance.gameObject.transform); gameObject.layer = LayerMask.NameToLayer("Flash"); diff --git a/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs index d60473bc..6eba7d93 100644 --- a/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs +++ b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs @@ -20,7 +20,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan public GameObject shadow; - private void Start() + private void Awake() { SpriteRenderer = this.gameObject.GetComponent(); SpriteRenderer.sprite = KarateMan.instance.BarrelSprites[spriteIndex]; diff --git a/Assets/Scripts/Games/KarateMan/Bomb.cs b/Assets/Scripts/Games/KarateMan/Bomb.cs index e9a7d536..2bf3dd40 100644 --- a/Assets/Scripts/Games/KarateMan/Bomb.cs +++ b/Assets/Scripts/Games/KarateMan/Bomb.cs @@ -29,7 +29,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan [SerializeField] private AnimationCurve outCurve; [SerializeField] private AnimationCurve shadowHitCurve; - private void Start() + private void Awake() { anim = GetComponent(); diff --git a/Assets/Scripts/Games/KarateMan/CookingPotDestroyEffect.cs b/Assets/Scripts/Games/KarateMan/CookingPotDestroyEffect.cs index a8c75780..86f1fd3d 100644 --- a/Assets/Scripts/Games/KarateMan/CookingPotDestroyEffect.cs +++ b/Assets/Scripts/Games/KarateMan/CookingPotDestroyEffect.cs @@ -17,7 +17,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan public GameObject pot; - private void Start() + private void Awake() { SpriteRenderer sr = gameObject.AddComponent(); sr.sprite = KarateMan.instance.CookingPotSprites[1]; diff --git a/Assets/Scripts/Games/KarateMan/Pot.cs b/Assets/Scripts/Games/KarateMan/Pot.cs index 59847fde..2aa47ef4 100644 --- a/Assets/Scripts/Games/KarateMan/Pot.cs +++ b/Assets/Scripts/Games/KarateMan/Pot.cs @@ -56,7 +56,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan private int missTimes = 0; - private void Start() + private void Awake() { anim = GetComponent(); spriteComp = Sprite.GetComponent(); diff --git a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs index bf6dfebb..26635336 100644 --- a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs +++ b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs @@ -30,10 +30,6 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - private void Start() - { canGo = false; man.stepTimes = 0; SetInterval(0); diff --git a/Assets/Scripts/Games/MrUpbeat/UpbeatStep.cs b/Assets/Scripts/Games/MrUpbeat/UpbeatStep.cs index 8b798099..7d01dcfc 100644 --- a/Assets/Scripts/Games/MrUpbeat/UpbeatStep.cs +++ b/Assets/Scripts/Games/MrUpbeat/UpbeatStep.cs @@ -14,7 +14,7 @@ namespace HeavenStudio.Games.Scripts_MrUpbeat private bool passedFirst = false; public float beatOffset = 0; - private void Start() + private void Awake() { PlayerActionInit(gameObject, startBeat); } diff --git a/Assets/Scripts/Games/RhythmRally/Paddlers.cs b/Assets/Scripts/Games/RhythmRally/Paddlers.cs index ac41bc49..a4b49673 100644 --- a/Assets/Scripts/Games/RhythmRally/Paddlers.cs +++ b/Assets/Scripts/Games/RhythmRally/Paddlers.cs @@ -15,7 +15,7 @@ namespace HeavenStudio.Games.Scripts_RhythmRally private Animator opponentAnim; private Conductor cond; - void Awake() + public void Init() { game = RhythmRally.instance; playerAnim = game.playerAnim; diff --git a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs index d04ee8f3..9c95aa97 100644 --- a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs +++ b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs @@ -55,13 +55,9 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - - void Start() - { + paddlers.Init(); renderQuadTrans.gameObject.SetActive(true); - + var cam = GameCamera.instance.camera; var camHeight = 2f * cam.orthographicSize; var camWidth = camHeight * cam.aspect; diff --git a/Assets/Scripts/Games/RhythmTweezers/Tweezers.cs b/Assets/Scripts/Games/RhythmTweezers/Tweezers.cs index b779f9ca..4addd786 100644 --- a/Assets/Scripts/Games/RhythmTweezers/Tweezers.cs +++ b/Assets/Scripts/Games/RhythmTweezers/Tweezers.cs @@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers public SpriteRenderer heldHairSprite; public Transform tweezerSpriteTrans; - private void Start() + private void Awake() { anim = GetComponent(); vegetableAnim = RhythmTweezers.instance.VegetableAnimator; diff --git a/Assets/Scripts/Games/SpaceSoccer/Ball.cs b/Assets/Scripts/Games/SpaceSoccer/Ball.cs index aa0ede21..b9c07f60 100644 --- a/Assets/Scripts/Games/SpaceSoccer/Ball.cs +++ b/Assets/Scripts/Games/SpaceSoccer/Ball.cs @@ -168,6 +168,11 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer { 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: { float normalizedBeatAnim = Conductor.instance.GetPositionFromBeat(startBeat, 2.35f); diff --git a/Assets/Scripts/Games/SpaceSoccer/Kicker.cs b/Assets/Scripts/Games/SpaceSoccer/Kicker.cs index b4d72334..8e023f03 100644 --- a/Assets/Scripts/Games/SpaceSoccer/Kicker.cs +++ b/Assets/Scripts/Games/SpaceSoccer/Kicker.cs @@ -20,22 +20,10 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer [Header("Components")] private Animator anim; public Ball ball; - public Transform rightLeg; - public Transform leftLeg; - private void Start() + private void Awake() { anim = GetComponent(); - 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() diff --git a/Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs b/Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs index 89aeb528..e5b0306a 100644 --- a/Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs +++ b/Assets/Scripts/Games/SpaceSoccer/SpaceSoccer.cs @@ -24,10 +24,6 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - private void Start() - { /*for (int x = 0; x < Random.Range(9, 12); x++) { for (int y = 0; y < Random.Range(6, 9); y++) diff --git a/Assets/Scripts/Games/Spaceball/Alien.cs b/Assets/Scripts/Games/Spaceball/Alien.cs index d8440f02..8b97537b 100644 --- a/Assets/Scripts/Games/Spaceball/Alien.cs +++ b/Assets/Scripts/Games/Spaceball/Alien.cs @@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball private float showBeat = 0; private bool isShowing = false; - private void Start() + private void Awake() { anim = GetComponent(); anim.Play("AlienIdle", 0, 0); diff --git a/Assets/Scripts/Games/Spaceball/Spaceball.cs b/Assets/Scripts/Games/Spaceball/Spaceball.cs index f43bc418..6a2d69b2 100644 --- a/Assets/Scripts/Games/Spaceball/Spaceball.cs +++ b/Assets/Scripts/Games/Spaceball/Spaceball.cs @@ -57,10 +57,6 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - } - - private void Start() - { var camEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "camera" }); List tempEvents = new List(); for (int i = 0; i < camEvents.Count; i++) diff --git a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs index 467fb39e..066ad3e2 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs @@ -26,7 +26,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball public float hitRot; public float randomEndPosX; - private void Start() + private void Awake() { anim = GetComponent(); diff --git a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs index 1c072062..0bc627d4 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs @@ -29,10 +29,6 @@ namespace HeavenStudio.Games.Scripts_Spaceball private void Awake() { instance = this; - } - - private void Start() - { anim = GetComponent(); } diff --git a/Assets/Scripts/Games/TapTrial/Tap.cs b/Assets/Scripts/Games/TapTrial/Tap.cs index 6b86f8eb..5361dd89 100644 --- a/Assets/Scripts/Games/TapTrial/Tap.cs +++ b/Assets/Scripts/Games/TapTrial/Tap.cs @@ -11,9 +11,8 @@ namespace HeavenStudio.Games.Scripts_TapTrial public float startBeat; public int type; - - // Start is called before the first frame update - void Start() + + void Awake() { PlayerActionInit(this.gameObject, startBeat); } diff --git a/Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs b/Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs index bcce02cb..9053d547 100644 --- a/Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs +++ b/Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs @@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_TapTrial public float nextBeat; public int tripleOffset = 0; - private void Start() + private void Awake() { anim = GetComponent(); } diff --git a/Assets/Scripts/Games/WizardsWaltz/MagicFX.cs b/Assets/Scripts/Games/WizardsWaltz/MagicFX.cs index a25709ad..fbdfcd74 100644 --- a/Assets/Scripts/Games/WizardsWaltz/MagicFX.cs +++ b/Assets/Scripts/Games/WizardsWaltz/MagicFX.cs @@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz public SpriteRenderer spriteRenderer; public GameObject shimmer; - public void Start() + public void Awake() { int order = (int)Math.Round((transform.position.z - 2) * 1000); spriteRenderer.sortingOrder = order; diff --git a/Assets/Scripts/Games/WizardsWaltz/Plant.cs b/Assets/Scripts/Games/WizardsWaltz/Plant.cs index ff2403f3..5832a531 100644 --- a/Assets/Scripts/Games/WizardsWaltz/Plant.cs +++ b/Assets/Scripts/Games/WizardsWaltz/Plant.cs @@ -20,10 +20,6 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz private void Awake() { game = WizardsWaltz.instance; - } - - private void Start() - { spriteRenderer.sortingOrder = order; animator.Play("Appear", 0, 0); } diff --git a/Assets/Scripts/Games/WizardsWaltz/Wizard.cs b/Assets/Scripts/Games/WizardsWaltz/Wizard.cs index 62381bbb..6209f902 100644 --- a/Assets/Scripts/Games/WizardsWaltz/Wizard.cs +++ b/Assets/Scripts/Games/WizardsWaltz/Wizard.cs @@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz private WizardsWaltz game; private float songPos; - private void Awake() + public void Init() { game = WizardsWaltz.instance; } diff --git a/Assets/Scripts/Games/WizardsWaltz/WizardsWaltz.cs b/Assets/Scripts/Games/WizardsWaltz/WizardsWaltz.cs index ae7170ca..7e864394 100644 --- a/Assets/Scripts/Games/WizardsWaltz/WizardsWaltz.cs +++ b/Assets/Scripts/Games/WizardsWaltz/WizardsWaltz.cs @@ -34,6 +34,7 @@ namespace HeavenStudio.Games private void Awake() { instance = this; + wizard.Init(); } private void Start()