public void SlotArmDown() { #if DEBUG #else if (!Player.main.inSeamoth || !AvatarInputHandler.main.IsEnabled()) { return; } #endif if (!seamoth.IsPowered()) { return; } if (currentSelectedArm == SeamothArm.Left) { leftButtonDownProcessed = true; if (seamoth.GetSlotProgress(LeftArmSlotID) != 1f) { return; } QuickSlotType quickSlotType = CraftData.GetQuickSlotType(currentLeftArmType); if (quickSlotType == QuickSlotType.Selectable && leftArm.OnUseDown(out float coolDown)) { if (EnergySource) { EnergySource.ConsumeEnergy(leftArm.GetEnergyCost()); } quickSlotTimeUsed[LeftArmSlotID] = Time.time; quickSlotCooldown[LeftArmSlotID] = coolDown; } } else if (currentSelectedArm == SeamothArm.Right) { rightButtonDownProcessed = true; if (seamoth.GetSlotProgress(RightArmSlotID) != 1f) { return; } QuickSlotType quickSlotType = CraftData.GetQuickSlotType(currentRightArmType); if (quickSlotType == QuickSlotType.Selectable && rightArm.OnUseDown(out float coolDown)) { if (EnergySource) { EnergySource.ConsumeEnergy(rightArm.GetEnergyCost()); } quickSlotTimeUsed[RightArmSlotID] = Time.time; quickSlotCooldown[RightArmSlotID] = coolDown; } } }
public void SlotArmHeld() { #if OUTSIDE_TEST_ENABLED #else if (!Player.main.inSeamoth || !AvatarInputHandler.main.IsEnabled()) { return; } #endif if (!seamoth.IsPowered()) { return; } if (currentSelectedArm == SeamothArm.Left) { if (!leftButtonDownProcessed) { return; } if (seamoth.GetSlotProgress(LeftArmSlotID) != 1f) { return; } QuickSlotType quickSlotType = CraftData.GetQuickSlotType(currentLeftArmType); if (quickSlotType == QuickSlotType.Selectable && leftArm.OnUseHeld(out float coolDown)) { quickSlotTimeUsed[LeftArmSlotID] = Time.time; quickSlotCooldown[LeftArmSlotID] = coolDown; } } else if (currentSelectedArm == SeamothArm.Right) { if (!rightButtonDownProcessed) { return; } if (seamoth.GetSlotProgress(RightArmSlotID) != 1f) { return; } QuickSlotType quickSlotType = CraftData.GetQuickSlotType(currentRightArmType); if (quickSlotType == QuickSlotType.Selectable && rightArm.OnUseHeld(out float coolDown)) { quickSlotTimeUsed[RightArmSlotID] = Time.time; quickSlotCooldown[RightArmSlotID] = coolDown; } } }