mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:07:38 +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:
@ -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<GameObject>();
|
||||
idolAnimator = Arisa.GetComponent<Animator>();
|
||||
|
||||
@ -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<NtrIdolFan>();
|
||||
mobj.transform.localPosition = new Vector3(spawnPos.x, spawnPos.y, spawnPos.z);
|
||||
mobj.GetComponent<SortingGroup>().sortingOrder = i + sortOrigin;
|
||||
if (i == 3)
|
||||
{
|
||||
Player = mobj.GetComponent<NtrIdolFan>();
|
||||
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)
|
||||
|
Reference in New Issue
Block a user