mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-22 17:45:16 +00:00
Merge pull request #23 from CarsonKompon/fix-fork-lifter-maximum-peas-on-fork
Fork now only holds up to 4 peas in Fork Lifter
This commit is contained in:
commit
51c4e01889
1 changed files with 31 additions and 28 deletions
|
@ -47,36 +47,39 @@ namespace RhythmHeavenMania.Games.ForkLifter
|
|||
{
|
||||
ForkLifterPlayer.instance.Stab(this);
|
||||
|
||||
GameObject pea = new GameObject();
|
||||
|
||||
pea.transform.parent = ForkLifterPlayer.instance.perfect.transform;
|
||||
pea.transform.localScale = Vector2.one;
|
||||
pea.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
||||
|
||||
pea.transform.localPosition = Vector3.zero;
|
||||
|
||||
for (int i = 0; i < ForkLifterPlayer.instance.perfect.transform.childCount; i++)
|
||||
if (ForkLifterPlayer.instance.currentPerfectPeasOnFork < 4)
|
||||
{
|
||||
ForkLifterPlayer.instance.perfect.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentPerfectPeasOnFork);
|
||||
}
|
||||
GameObject pea = new GameObject();
|
||||
|
||||
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
||||
psprite.sprite = ForkLifter.instance.peaHitSprites[type];
|
||||
psprite.sortingOrder = 20;
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
psprite.sortingOrder = 101;
|
||||
break;
|
||||
case 1:
|
||||
psprite.sortingOrder = 104;
|
||||
break;
|
||||
case 2:
|
||||
psprite.sortingOrder = 103;
|
||||
break;
|
||||
case 3:
|
||||
psprite.sortingOrder = 102;
|
||||
break;
|
||||
pea.transform.parent = ForkLifterPlayer.instance.perfect.transform;
|
||||
pea.transform.localScale = Vector2.one;
|
||||
pea.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
||||
|
||||
pea.transform.localPosition = Vector3.zero;
|
||||
|
||||
for (int i = 0; i < ForkLifterPlayer.instance.perfect.transform.childCount; i++)
|
||||
{
|
||||
ForkLifterPlayer.instance.perfect.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentPerfectPeasOnFork);
|
||||
}
|
||||
|
||||
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
||||
psprite.sprite = ForkLifter.instance.peaHitSprites[type];
|
||||
psprite.sortingOrder = 20;
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
psprite.sortingOrder = 101;
|
||||
break;
|
||||
case 1:
|
||||
psprite.sortingOrder = 104;
|
||||
break;
|
||||
case 2:
|
||||
psprite.sortingOrder = 103;
|
||||
break;
|
||||
case 3:
|
||||
psprite.sortingOrder = 102;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GameObject hitFXo = new GameObject();
|
||||
|
|
Loading…
Reference in a new issue