Created
January 15, 2023 15:08
-
-
Save syl3n7/23eb7a394e1140549e4b0aac01e5b842 to your computer and use it in GitHub Desktop.
Get Battery status and change sprite acordingly
This file contains hidden or 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
void CheckBattery() | |
{ | |
//if (menuPanel.activeSelf) | |
//{ | |
//playername.text = PlayerPrefs.GetString("Name"); | |
if (battery == BatteryStatus.Charging) batteryimg.sprite = Resources.Load<Sprite>("bateriaCharging"); | |
else if (battery == BatteryStatus.Discharging) batteryimg.sprite = Resources.Load<Sprite>("bateriaDischarging"); | |
else batteryimg.sprite = Resources.Load<Sprite>("bateriaFull"); | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment