quantum-space-buddies/QSB/Tools/QSBTool.cs

62 lines
1.1 KiB
C#
Raw Normal View History

2021-12-14 22:53:53 +00:00
using QSB.Player;
using UnityEngine;
2020-07-29 21:04:50 +00:00
namespace QSB.Tools
2020-07-29 21:04:50 +00:00
{
2020-12-02 21:23:01 +00:00
public class QSBTool : PlayerTool
{
2021-12-14 22:53:53 +00:00
public PlayerInfo Player { get; set; }
2020-12-02 21:23:01 +00:00
public ToolType Type { get; set; }
public GameObject ToolGameObject { get; set; }
public DampedSpringQuat MoveSpring
{
get => _moveSpring;
set => _moveSpring = value;
}
public Transform StowTransform
{
get => _stowTransform;
set => _stowTransform = value;
}
public Transform HoldTransform
{
get => _holdTransform;
set => _holdTransform = value;
}
public float ArrivalDegrees
{
get => _arrivalDegrees;
set => _arrivalDegrees = value;
}
2021-11-10 09:12:05 +00:00
public virtual void OnEnable() => ToolGameObject?.SetActive(true);
public virtual void OnDisable() => ToolGameObject?.SetActive(false);
2020-12-02 21:23:01 +00:00
public void ChangeEquipState(bool equipState)
{
if (equipState)
{
EquipTool();
2020-12-11 23:13:13 +00:00
return;
2020-12-02 21:23:01 +00:00
}
2021-06-18 21:38:32 +00:00
2020-12-11 23:13:13 +00:00
UnequipTool();
2020-12-02 21:23:01 +00:00
}
2021-12-14 22:53:53 +00:00
public override void EquipTool()
{
base.EquipTool();
Player.AudioController.PlayEquipTool();
}
public override void UnequipTool()
{
base.UnequipTool();
Player.AudioController.PlayUnequipTool();
}
2020-12-02 21:23:01 +00:00
}
2020-07-29 21:04:50 +00:00
}