RocketDataScript.cs 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using UnityEngine;
  2. [CreateAssetMenu(fileName = "RocketDataScript", menuName = "Scriptable Objects/RocketDataScript")]
  3. public class RocketDataScript : ScriptableObject
  4. {
  5. [SerializeField] private float fuel = 10;
  6. [SerializeField] private float force = 1;
  7. [SerializeField] private float mass;
  8. [SerializeField] private float thrust;
  9. [SerializeField] private float thrustLever;
  10. public float thrustLeverStep = 0.5f;
  11. public float Fuel => fuel;
  12. public float Force => force;
  13. public float Mass => mass;
  14. public float Thrust => thrust;
  15. public float ThrustLever => thrustLever;
  16. public void AddFuel(float value)
  17. {
  18. fuel += value;
  19. }
  20. public void SetFuel(float value)
  21. {
  22. fuel = value;
  23. }
  24. public void SetMass(float value)
  25. {
  26. mass = value;
  27. }
  28. public void SetThrust(float value)
  29. {
  30. thrust = value;
  31. }
  32. public void SetThrustLever(float value)
  33. {
  34. thrustLever = value;
  35. }
  36. }