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
This commit is contained in:
Slaith
2022-03-25 19:08:46 -07:00
parent 31c91fa3bf
commit ebeea121ed
40 changed files with 50 additions and 100 deletions

View File

@ -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);
}

View File

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

View File

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