static void addSwapperSwapButtons(MeetingHud __instance) { if (Swapper.swapper == null || PlayerControl.LocalPlayer != Swapper.swapper || Swapper.swapper.Data.IsDead) { return; } selections = new bool[__instance.playerStates.Length]; renderers = new SpriteRenderer[__instance.playerStates.Length]; for (int i = 0; i < __instance.playerStates.Length; i++) { PlayerVoteArea playerVoteArea = __instance.playerStates[i]; GameObject template = playerVoteArea.Buttons.transform.Find("CancelButton").gameObject; GameObject checkbox = UnityEngine.Object.Instantiate(template); checkbox.transform.SetParent(playerVoteArea.transform); checkbox.transform.position = template.transform.position; checkbox.transform.localPosition = new Vector3(0f, 0.03f, template.transform.localPosition.z); SpriteRenderer renderer = checkbox.GetComponent <SpriteRenderer>(); renderer.sprite = Swapper.getCheckSprite(); renderer.color = Color.red; PassiveButton button = checkbox.GetComponent <PassiveButton>(); button.OnClick.RemoveAllListeners(); int copiedIndex = i; button.OnClick.AddListener((UnityEngine.Events.UnityAction)(() => onClick(copiedIndex, __instance))); selections[i] = false; renderers[i] = renderer; } }
public static void clearAndReloadRoles() { Jester.clearAndReload(); Mayor.clearAndReload(); Engineer.clearAndReload(); Sheriff.clearAndReload(); Lighter.clearAndReload(); Godfather.clearAndReload(); Mafioso.clearAndReload(); Janitor.clearAndReload(); Detective.clearAndReload(); TimeMaster.clearAndReload(); Medic.clearAndReload(); Shifter.clearAndReload(); Swapper.clearAndReload(); Lovers.clearAndReload(); Seer.clearAndReload(); Morphling.clearAndReload(); Camouflager.clearAndReload(); Spy.clearAndReload(); Child.clearAndReload(); }