Created
September 25, 2019 14:47
-
-
Save blackbret94/987a60af912494bbde08cf497c023957 to your computer and use it in GitHub Desktop.
This is a very simple extension of MonoBehaviour I use in every Unity project. Every panel class in my games extend this class, allowing for a common interface across all panels.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace Bretblack.Games.GUI | |
{ | |
public class GamePanel : MonoBehaviour | |
{ | |
public virtual void SetActive(bool b) | |
{ | |
gameObject.SetActive(b); | |
} | |
public virtual void OpenPanel() | |
{ | |
gameObject.SetActive(true); | |
} | |
public virtual void ClosePanel() | |
{ | |
gameObject.SetActive(false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment