-
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: register indomie instant noodle pack item
- Loading branch information
Showing
5 changed files
with
61 additions
and
34 deletions.
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,43 @@ | ||
using LethalLib.Modules; | ||
using UnityEngine; | ||
|
||
namespace DingusThings.CustomScriptableObject | ||
{ | ||
internal class InstantNoodlePackItem | ||
{ | ||
public static void Register() | ||
{ | ||
AssetBundle? bundle = DingusThings.Bundle; | ||
if (bundle == null) | ||
{ | ||
DingusThings.Logger.LogError("Instant noodle packs failed to load."); | ||
return; | ||
} | ||
|
||
int rarity = 70; | ||
Item maggiItem = bundle.LoadAsset<Item>("Assets/DingusThings/Items/MaggiInstantNoodlePack.asset"); | ||
PhysicsProp maggiPhysicsProp = maggiItem.spawnPrefab.AddComponent<PhysicsProp>(); | ||
maggiPhysicsProp.grabbable = true; | ||
maggiPhysicsProp.grabbableToEnemies = true; | ||
maggiPhysicsProp.isInFactory = true; | ||
maggiPhysicsProp.itemProperties = maggiItem; | ||
|
||
// register scrap | ||
NetworkPrefabs.RegisterNetworkPrefab(maggiItem.spawnPrefab); | ||
Utilities.FixMixerGroups(maggiItem.spawnPrefab); | ||
Items.RegisterScrap(maggiItem, rarity, Levels.LevelTypes.All); | ||
|
||
Item indomieItem = bundle.LoadAsset<Item>("Assets/DingusThings/Items/IndomieInstantNoodlePack.asset"); | ||
PhysicsProp indomiePhysicsProp = indomieItem.spawnPrefab.AddComponent<PhysicsProp>(); | ||
indomiePhysicsProp.grabbable = true; | ||
indomiePhysicsProp.grabbableToEnemies = true; | ||
indomiePhysicsProp.isInFactory = true; | ||
indomiePhysicsProp.itemProperties = maggiItem; | ||
|
||
// register scrap | ||
NetworkPrefabs.RegisterNetworkPrefab(indomieItem.spawnPrefab); | ||
Utilities.FixMixerGroups(indomieItem.spawnPrefab); | ||
Items.RegisterScrap(indomieItem, rarity, Levels.LevelTypes.All); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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