private int MoveSelection(int selection, int max, bool isRight) { if (isRight) { selection++; if (selection == max) { selection = 0; } } else { selection--; if (selection < 0) { selection = max - 1; } } if (m_VerticalPosition == 0) { DisplaySponsor(selection); } if (m_VerticalPosition == 1) { DisplayAbility(selection); } m_DelayManager.AddShieldDelay(Database.instance.MenuInputDelay); SoundManager.PlaySFX(Database.instance.MenuSlideName); return(selection); }
public void FlushAlivePlayerInputs() { foreach (GameObject pg in m_Players) { if (pg != null) { IPlatformer2DUserControl controls = pg.GetComponent <IPlatformer2DUserControl>(); if (controls != null) { controls.FlushInputs(); } PlatformerCharacter2D charac = pg.GetComponent <PlatformerCharacter2D>(); if (charac != null) { charac.FlushAnimState(); } DelayManager dm = pg.GetComponent <DelayManager>(); if (dm != null) { dm.AddDelay(Database.instance.MenuInputDelay); dm.AddShieldDelay(Database.instance.MenuInputDelay); } } } }