Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
SwitchFurnitureElectricElement.cs
浏览该文件的文档.
1using Engine;
2
3namespace Game {
5 public float m_voltage;
6
7 public SwitchFurnitureElectricElement(SubsystemElectricity subsystemElectricity, Point3 point, int value) :
8 base(subsystemElectricity, point) {
10 if (design != null
11 && design.LinkedDesign != null) {
12 m_voltage = design.Index >= design.LinkedDesign.Index ? 1 : 0;
13 }
14 }
15
16 public override float GetOutputVoltage(int face) => m_voltage;
17
18 public override bool OnInteract(TerrainRaycastResult raycastResult, ComponentMiner componentMiner) {
19 CellFace cellFace = CellFaces[0];
21 SubsystemElectricity.SubsystemAudio.PlaySound("Audio/Click", 1f, 0f, new Vector3(cellFace.X, cellFace.Y, cellFace.Z), 2f, true);
22 return true;
23 }
24 }
25}
Engine.Vector3 Vector3
ReadOnlyList< CellFace > CellFaces
static FurnitureDesign GetDesign(SubsystemFurnitureBlockBehavior subsystemFurnitureBlockBehavior, int value)
FurnitureElectricElement(SubsystemElectricity subsystemElectricity, Point3 point)
void PlaySound(string name, float volume, float pitch, float pan, float delay)
void SwitchToNextState(int x, int y, int z, bool playSound)
virtual SubsystemFurnitureBlockBehavior SubsystemFurnitureBlockBehavior
SwitchFurnitureElectricElement(SubsystemElectricity subsystemElectricity, Point3 point, int value)
override bool OnInteract(TerrainRaycastResult raycastResult, ComponentMiner componentMiner)