Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
SubsystemChestBlockBehavior.cs
浏览该文件的文档.
2
3namespace Game {
5 public override int[] HandledBlocks => [45];
6
7 public override void Load(ValuesDictionary valuesDictionary) {
8 base.Load(valuesDictionary);
9 m_databaseObject = Project.GameDatabase.Database.FindDatabaseObject("Chest", Project.GameDatabase.EntityTemplateType, true);
10 }
11
12 public override bool InteractBlockEntity(ComponentBlockEntity blockEntity, ComponentMiner componentMiner) {
13 if (blockEntity != null
14 && componentMiner.ComponentPlayer != null) {
15 ComponentChest componentChest = blockEntity.Entity.FindComponent<ComponentChest>(true);
16 componentMiner.ComponentPlayer.ComponentGui.ModalPanelWidget = new ChestWidget(componentMiner.Inventory, componentChest);
17 AudioManager.PlaySound("Audio/UI/ButtonClick", 1f, 0f, 0f);
18 return true;
19 }
20 return false;
21 }
22 }
23}
static void PlaySound(string name, float volume, float pitch, float pan)
ComponentPlayer ComponentPlayer
override void Load(ValuesDictionary valuesDictionary)
override bool InteractBlockEntity(ComponentBlockEntity blockEntity, ComponentMiner componentMiner)
Component FindComponent(Type type, string name, bool throwOnError)
ValuesDictionary ValuesDictionary