mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:37:40 +02:00
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:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
|
||||
private CropStomp game;
|
||||
|
||||
private void Start()
|
||||
public void Init()
|
||||
{
|
||||
game = CropStomp.instance;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
|
||||
private CropStomp game;
|
||||
|
||||
private void Start()
|
||||
public void Init()
|
||||
{
|
||||
game = CropStomp.instance;
|
||||
|
||||
|
Reference in New Issue
Block a user