Ejemplo n.º 1
0
 public static void Postfix(HudManager __instance)
 {
     swordButton = new CooldownButton(
         () =>
     {
         if (isReveal)
         {
             swordButton.Image   = AssetLoader.hideSprite;
             isReveal            = false;
             GameObject newsword = GameObject.Instantiate(AssetLoader.sword); newsword.transform.Find("katana").transform.Find("hitbox").gameObject.AddComponent <SwordMono>().owner = PlayerControl.LocalPlayer;
             newsword.transform.Find("katana").transform.Find("hitbox").gameObject.GetComponent <SwordMono>().Attach();
             Rpc <CreateSword> .Instance.Send((PlayerControl.LocalPlayer.PlayerId, 0));
         }
         else
         {
             swordButton.Image = AssetLoader.revealSprite;
             isReveal          = true;
             GameObject.Find(PlayerControl.LocalPlayer.gameObject.name).transform.Find("senseiSword(Clone)").transform.Find("katana").transform.Find("hitbox").GetComponent <SwordMono>().destoryMe = true;
             Rpc <BreakSword> .Instance.Send((PlayerControl.LocalPlayer.PlayerId, 0));
         }
     },
         1f,
         AssetLoader.revealSprite,
         Vector2.zero,
         () =>
     {
         return(!PlayerControl.LocalPlayer.Data.IsDead && huduppatch.localIsSensei && MeetingHud.Instance == null && (AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started || AmongUsClient.Instance.GameMode == GameModes.FreePlay));
     },
         __instance
         );
 }
Ejemplo n.º 2
0
 public static void Postfix(HudManager __instance)
 {
     CooldownButton.HudUpdate();
 }