Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- public class core : MonoBehaviour {
- #region Start
- public static core Index;
- void Start() {
- Index = this;
- FindGameScripts();
- }
- #endregion
- void Update() {
- SetFrameRate();
- }
- #region FrameRate Limiter
- [SerializeField] bool LimitFrameRate;
- int framerateMinimum = 30;
- int framerateMaximum = 60;
- void SetFrameRate() {
- if (LimitFrameRate == true) {
- if (Application.targetFrameRate != framerateMinimum) {
- Application.targetFrameRate = framerateMinimum;
- }
- } else {
- if (Application.targetFrameRate != framerateMaximum) {
- Application.targetFrameRate = framerateMaximum;
- }
- }
- }
- #endregion
- #region Scripts
- void FindGameScripts() {
- FindPlayerScripts();
- FindEnemyScripts();
- }
- #region Player Scripts
- public GameObject Player;
- [HideInInspector] public playerCore PlayerCore;
- [HideInInspector] public playerCombat PlayerCombat;
- void FindPlayerScripts() {
- PlayerCore = Player.GetComponent<playerCore>();
- PlayerCombat = Player.GetComponent<playerCombat>();
- }
- #endregion
- #region Enemy Scripts
- public GameObject Enemies;
- [HideInInspector] public enemySpawning EnemySpawning;
- void FindEnemyScripts() {
- EnemySpawning = Enemies.GetComponent<enemySpawning>();
- }
- #endregion
- #endregion
- #region Panels
- #region Character
- // Allows you to set a hotkey in the Inspector
- public KeyCode HotkeyCharacter;
- public GameObject PanelCharacter;
- void TogglePanel() {
- // If you press the Hotkey for this Panel
- if (Input.GetKey(HotkeyCharacter)) {
- // If the Panel is not active
- if(PanelCharacter.activeSelf == false) {
- // Set it Active
- PanelCharacter.SetActive(true);
- // Otherwise
- } else {
- // Set it Inactive
- PanelCharacter.SetActive(false);
- }
- }
- }
- #endregion
- #region Skills
- #endregion
- #region Inventory
- #endregion
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement