public bool UseAbility(KillButtonManager __instance) { if (__instance == HackButton) { HackButtonHandler.HackButtonPress(this, __instance); } else if (__instance == MimicButton) { MimicButtonHandler.MimicButtonPress(this, __instance); } else { KillButtonHandler.KillButtonPress(this, __instance); } return(false); }
public void FixedUpdate(HudManager __instance) { KillButtonHandler.KillButtonUpdate(this, __instance); MimicButtonHandler.MimicButtonUpdate(this, __instance); HackButtonHandler.HackButtonUpdate(this, __instance); if (__instance.KillButton != null && Player.Data.IsDead) { __instance.KillButton.SetTarget(null); } if (MimicButton != null && Player.Data.IsDead) { MimicButton.SetTarget(null); } if (HackButton != null && Player.Data.IsDead) { HackButton.SetTarget(null); } if (MimicList != null) { if (Minigame.Instance) { Minigame.Instance.Close(); } if (!MimicList.IsOpen || MeetingHud.Instance) { MimicList.Toggle(); MimicList.SetVisible(false); MimicList = null; } else { foreach (var bubble in MimicList.chatBubPool.activeChildren) { if (!this.IsUsingMimic && this.MimicList != null) { Vector2 ScreenMin = Camera.main.WorldToScreenPoint(bubble.Cast <ChatBubble>().Background.bounds.min); Vector2 ScreenMax = Camera.main.WorldToScreenPoint(bubble.Cast <ChatBubble>().Background.bounds.max); if (Input.mousePosition.x > ScreenMin.x && Input.mousePosition.x < ScreenMax.x) { if (Input.mousePosition.y > ScreenMin.y && Input.mousePosition.y < ScreenMax.y) { if (!Input.GetMouseButtonDown(0) && this.lastMouse) { this.lastMouse = false; this.MimicList.Toggle(); this.MimicList.SetVisible(false); this.MimicList = null; RpcSetMimicked(PlayerControl.AllPlayerControls.ToArray().Where(x => x.Data.PlayerName == bubble.Cast <ChatBubble>().NameText.text) .FirstOrDefault()); break; } this.lastMouse = Input.GetMouseButtonDown(0); } } } } } } }