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