Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class core : MonoBehaviour {
  5.  
  6. #region Start
  7.  
  8. public static core Index;
  9.  
  10. void Start() {
  11.  
  12. Index = this;
  13.  
  14. FindGameScripts();
  15.  
  16. }
  17.  
  18. #endregion
  19.  
  20. void Update() {
  21.  
  22. SetFrameRate();
  23.  
  24. }
  25.  
  26. #region FrameRate Limiter
  27.  
  28. [SerializeField] bool LimitFrameRate;
  29.  
  30. int framerateMinimum = 30;
  31. int framerateMaximum = 60;
  32.  
  33. void SetFrameRate() {
  34.  
  35. if (LimitFrameRate == true) {
  36.  
  37. if (Application.targetFrameRate != framerateMinimum) {
  38.  
  39. Application.targetFrameRate = framerateMinimum;
  40.  
  41. }
  42.  
  43. } else {
  44.  
  45. if (Application.targetFrameRate != framerateMaximum) {
  46.  
  47. Application.targetFrameRate = framerateMaximum;
  48.  
  49. }
  50.  
  51. }
  52.  
  53. }
  54.  
  55. #endregion
  56.  
  57. #region Scripts
  58.  
  59. void FindGameScripts() {
  60.  
  61. FindPlayerScripts();
  62. FindEnemyScripts();
  63.  
  64. }
  65.  
  66. #region Player Scripts
  67.  
  68. public GameObject Player;
  69. [HideInInspector] public playerCore PlayerCore;
  70. [HideInInspector] public playerCombat PlayerCombat;
  71.  
  72. void FindPlayerScripts() {
  73.  
  74. PlayerCore = Player.GetComponent<playerCore>();
  75. PlayerCombat = Player.GetComponent<playerCombat>();
  76.  
  77. }
  78.  
  79. #endregion
  80.  
  81. #region Enemy Scripts
  82.  
  83. public GameObject Enemies;
  84. [HideInInspector] public enemySpawning EnemySpawning;
  85.  
  86. void FindEnemyScripts() {
  87.  
  88. EnemySpawning = Enemies.GetComponent<enemySpawning>();
  89.  
  90. }
  91.  
  92. #endregion
  93.  
  94. #endregion
  95.  
  96. #region Panels
  97.  
  98. #region Character
  99.  
  100. // Allows you to set a hotkey in the Inspector
  101. public KeyCode HotkeyCharacter;
  102. public GameObject PanelCharacter;
  103.  
  104. void TogglePanel() {
  105.  
  106. // If you press the Hotkey for this Panel
  107. if (Input.GetKey(HotkeyCharacter)) {
  108.  
  109. // If the Panel is not active
  110. if(PanelCharacter.activeSelf == false) {
  111.  
  112. // Set it Active
  113. PanelCharacter.SetActive(true);
  114.  
  115. // Otherwise
  116. } else {
  117.  
  118. // Set it Inactive
  119. PanelCharacter.SetActive(false);
  120.  
  121. }
  122.  
  123. }
  124.  
  125. }
  126.  
  127. #endregion
  128.  
  129. #region Skills
  130.  
  131. #endregion
  132.  
  133. #region Inventory
  134.  
  135. #endregion
  136.  
  137. #endregion
  138.  
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement