-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add maggi instant noodle pack item
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using LethalLib.Modules; | ||
using UnityEngine; | ||
|
||
namespace DingusThings.CustomScriptableObject | ||
{ | ||
internal class MaggiInstantNoodlePackItem | ||
{ | ||
public static void Register() | ||
{ | ||
string itemName = "Maggi Instant Noodle pack"; | ||
AssetBundle? bundle = DingusThings.Bundle; | ||
if (bundle == null) | ||
{ | ||
DingusThings.Logger.LogError(itemName + " failed to load."); | ||
return; | ||
} | ||
|
||
int rarity = 70; | ||
Item item = bundle.LoadAsset<Item>("Assets/DingusThings/Items/MaggiInstantNoodlePack.asset"); | ||
PhysicsProp physicsProp = item.spawnPrefab.AddComponent<PhysicsProp>(); | ||
physicsProp.grabbable = true; | ||
physicsProp.grabbableToEnemies = true; | ||
physicsProp.isInFactory = true; | ||
physicsProp.itemProperties = item; | ||
|
||
// register scrap | ||
NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab); | ||
Utilities.FixMixerGroups(item.spawnPrefab); | ||
Items.RegisterScrap(item, rarity, Levels.LevelTypes.All); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters