DetonatorComponent.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using UnityEngine;
  3. public abstract class DetonatorComponent : MonoBehaviour
  4. {
  5. public abstract void Explode();
  6. public abstract void Init();
  7. public void SetStartValues()
  8. {
  9. this.startSize = this.size;
  10. this.startForce = this.force;
  11. this.startVelocity = this.velocity;
  12. this.startDuration = this.duration;
  13. this.startDetail = this.detail;
  14. this.startColor = this.color;
  15. this.startLocalPosition = this.localPosition;
  16. }
  17. public Detonator MyDetonator()
  18. {
  19. return base.GetComponent("Detonator") as Detonator;
  20. }
  21. public bool on = true;
  22. public bool detonatorControlled = true;
  23. [HideInInspector]
  24. public float startSize = 1f;
  25. public float size = 1f;
  26. public float explodeDelayMin;
  27. public float explodeDelayMax;
  28. [HideInInspector]
  29. public float startDuration = 2f;
  30. public float duration = 2f;
  31. [HideInInspector]
  32. public float timeScale = 1f;
  33. [HideInInspector]
  34. public float startDetail = 1f;
  35. public float detail = 1f;
  36. [HideInInspector]
  37. public Color startColor = Color.white;
  38. public Color color = Color.white;
  39. [HideInInspector]
  40. public Vector3 startLocalPosition = Vector3.zero;
  41. public Vector3 localPosition = Vector3.zero;
  42. [HideInInspector]
  43. public Vector3 startForce = Vector3.zero;
  44. public Vector3 force = Vector3.zero;
  45. [HideInInspector]
  46. public Vector3 startVelocity = Vector3.zero;
  47. public Vector3 velocity = Vector3.zero;
  48. public float detailThreshold;
  49. }