Cardlife mod patcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
5.3KB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using UnityEngine;
  5. namespace IllusionInjector
  6. {
  7. public class PluginComponent : MonoBehaviour
  8. {
  9. private CompositePlugin plugins;
  10. private bool freshlyLoaded = false;
  11. private bool quitting = false;
  12. public static PluginComponent Create()
  13. {
  14. return new GameObject("IPA_PluginManager").AddComponent<PluginComponent>();
  15. }
  16. void Awake()
  17. {
  18. DontDestroyOnLoad(gameObject);
  19. plugins = new CompositePlugin(PluginManager.Plugins);
  20. plugins.OnApplicationStart();
  21. }
  22. void Start()
  23. {
  24. }
  25. void Update()
  26. {
  27. plugins.OnUpdate();
  28. }
  29. void LateUpdate()
  30. {
  31. plugins.OnLateUpdate();
  32. }
  33. void FixedUpdate()
  34. {
  35. plugins.OnFixedUpdate();
  36. }
  37. void OnDestroy()
  38. {
  39. if (!quitting)
  40. {
  41. Create();
  42. }
  43. }
  44. void OnApplicationQuit()
  45. {
  46. plugins.OnApplicationQuit();
  47. quitting = true;
  48. }
  49. private void OnAnimatorIK(int layerIndex)
  50. {
  51. plugins.OnAnimatorIK(layerIndex);
  52. }
  53. private void OnAnimatorMove() { plugins.OnAnimatorMove(); }
  54. private void OnApplicationFocus(bool hasFocus) { plugins.OnApplicationFocus(hasFocus); }
  55. private void OnApplicationPause(bool pauseStatus) { plugins.OnApplicationPause(pauseStatus); }
  56. private void OnAudioFilterRead(float[] data, int channels) { plugins.OnAudioFilterRead(data, channels); }
  57. private void OnBecameInvisible() { plugins.OnBecameInvisible(); }
  58. private void OnBecameVisible() { plugins.OnBecameVisible(); }
  59. private void OnBeforeTransformParentChanged() { plugins.OnBeforeTransformParentChanged(); }
  60. private void OnCanvasGroupChanged() { plugins.OnCanvasGroupChanged(); }
  61. private void OnCanvasHierarchyChanged() { plugins.OnCanvasHierarchyChanged(); }
  62. private void OnCollisionEnter(Collision other) { plugins.OnCollisionEnter(other); }
  63. private void OnCollisionEnter2D(Collision2D other) { plugins.OnCollisionEnter2D(other); }
  64. private void OnCollisionExit(Collision other) { plugins.OnCollisionExit(other); }
  65. private void OnCollisionExit2D(Collision2D other) { plugins.OnCollisionExit2D(other); }
  66. private void OnCollisionStay(Collision other) { plugins.OnCollisionStay(other); }
  67. private void OnCollisionStay2D(Collision2D other) { plugins.OnCollisionStay2D(other); }
  68. private void OnConnectedToServer() { plugins.OnConnectedToServer(); }
  69. private void OnControllerColliderHit(ControllerColliderHit hit) { plugins.OnControllerColliderHit(hit); }
  70. private void OnDidApplyAnimationProperties() { plugins.OnDidApplyAnimationProperties(); }
  71. private void OnDisable() { plugins.OnDisable(); }
  72. private void OnDrawGizmos() { plugins.OnDrawGizmos(); }
  73. private void OnDrawGizmosSelected() { plugins.OnDrawGizmosSelected(); }
  74. private void OnEnable() { plugins.OnEnable(); }
  75. private void OnGUI() { plugins.OnGUI(); }
  76. private void OnJointBreak(float breakForce) { plugins.OnJointBreak(breakForce); }
  77. private void OnMouseDown() { plugins.OnMouseDown(); }
  78. private void OnMouseDrag() { plugins.OnMouseDrag(); }
  79. private void OnMouseEnter() { plugins.OnMouseEnter(); }
  80. private void OnMouseExit() { plugins.OnMouseExit(); }
  81. private void OnMouseOver() { plugins.OnMouseOver(); }
  82. private void OnMouseUp() { plugins.OnMouseUp(); }
  83. private void OnMouseUpAsButton() { plugins.OnMouseUpAsButton(); }
  84. private void OnParticleCollision(GameObject other) { plugins.OnParticleCollision(other); }
  85. private void OnPostRender() { plugins.OnPostRender(); }
  86. private void OnPreCull() { plugins.OnPreCull(); }
  87. private void OnPreRender() { plugins.OnPreRender(); }
  88. private void OnRectTransformDimensionsChange() { plugins.OnRectTransformDimensionsChange(); }
  89. private void OnRenderImage(RenderTexture src, RenderTexture dest) { plugins.OnRenderImage(src, dest); }
  90. private void OnRenderObject() { plugins.OnRenderObject(); }
  91. private void OnServerInitialized() { plugins.OnServerInitialized(); }
  92. private void OnTransformChildrenChanged() { plugins.OnTransformChildrenChanged(); }
  93. private void OnTransformParentChanged() { plugins.OnTransformParentChanged(); }
  94. private void OnTriggerEnter(Collider other) { plugins.OnTriggerEnter(other); }
  95. private void OnTriggerEnter2D(Collider2D other) { plugins.OnTriggerEnter2D(other); }
  96. private void OnTriggerExit(Collider other) { plugins.OnTriggerExit(other); }
  97. private void OnTriggerExit2D(Collider2D other) { plugins.OnTriggerExit2D(other); }
  98. private void OnTriggerStay(Collider other) { plugins.OnTriggerStay(other); }
  99. private void OnTriggerStay2D(Collider2D other) { plugins.OnTriggerStay2D(other); }
  100. private void OnValidate() { plugins.OnValidate(); }
  101. private void OnWillRenderObject() { plugins.OnWillRenderObject(); }
  102. private void Reset() { plugins.Reset(); }
  103. }
  104. }