Example #1
0
 public void Update()
 {
     NModLoader.Update();
     if (Input.GetKeyDown(KeyCode.F2))
     {
         //Get the player body to use a position:
         var transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         //And then drop our defined item in front of the player.
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(NModLoader.LoadedCustomItems[Envy.Name].Index), transform.position, transform.forward * 20f);
     }
     if (Input.GetKeyDown(KeyCode.F3))
     {
         //Get the player body to use a position:
         var transform   = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         var customItems = NModLoader.LoadedCustomItems.Values.ToArray();
         for (var i = 0; i < customItems.Length; i++)
         {
             var rotation = Math.PI * 2 * (i / (float)customItems.Length);
             PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(customItems[i].Index), transform.position, new Vector3((float)Math.Cos(rotation), 0.05f, (float)Math.Sin(rotation)) * 30f);
         }
     }
     if (Input.GetKeyDown(KeyCode.F4))
     {
         //Get the player body to use a position:
         var transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         //And then drop our defined item in front of the player.
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex((ItemIndex)53), transform.position, transform.forward * 20f);
     }
 }
Example #2
0
 public void Awake()
 {
     _modInstance = this;
     NModLoader.Init();
 }