Why7090

Besiege ShowHiddenBlocks Mod

Jan 18th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using spaar.ModLoader;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5.  
  6. namespace ShowHiddenBlocks
  7. {
  8.  
  9.     // If you need documentation about any of these values or the mod loader
  10.     // in general, take a look at https://spaar.github.io/besiege-modloader.
  11.  
  12.     public class YourMod : Mod
  13.     {
  14.         public override string Name { get; } = "ShowHiddenBlocks";
  15.         public override string DisplayName { get; } = "Show Hidden Blocks";
  16.         public override string Author { get; } = "Why7090";
  17.         public override Version Version { get; } = new Version(0, 0, 1);
  18.  
  19.         // You don't need to override this, if you leavie it out it will default
  20.         // to an empty string.
  21.         public override string VersionExtra { get; } = "";
  22.  
  23.         // You don't need to override this, if you leave it out it will default
  24.         // to the current version.
  25.         public override string BesiegeVersion { get; } = "v0.42";
  26.  
  27.         // You don't need to override this, if you leave it out it will default
  28.         // to false.
  29.         public override bool CanBeUnloaded { get; } = false;
  30.  
  31.         // You don't need to override this, if you leave it out it will default
  32.         // to false.
  33.         public override bool Preload { get; } = false;
  34.  
  35.         static void Show (Scene s, LoadSceneMode mode)
  36.         {
  37.             GameObject scalingBlock = GameObject.Find("HUD/BottomBar/AlignBottomLeft/BLOCK BUTTONS/t_BLOCKS/Scaling Block");
  38.             if (scalingBlock == null)
  39.             {
  40.                 return;
  41.             }
  42.             scalingBlock.SetActive(true);
  43.            
  44.             GameObject magnet = GameObject.Find("HUD/BottomBar/AlignBottomLeft/BLOCK BUTTONS/t_MECHANICAL/Magnet");
  45.             if (magnet == null)
  46.             {
  47.                 return;
  48.             }
  49.             magnet.SetActive(true);
  50.         }
  51.  
  52.  
  53.         public override void OnLoad ()
  54.         {
  55.             SceneManager.sceneLoaded += Show;
  56.         }
  57.  
  58.         public override void OnUnload ()
  59.         {
  60.             // Your code here
  61.             // e.g. save configuration, destroy your objects if CanBeUnloaded is true etc
  62.         }
  63.     }
  64. }
Add Comment
Please, Sign In to add comment