I’m making a menu manager and I’m not sure what should I do to make a transition from one menu to the other. What is better to used? performance wise? Here is the step in my mind.
Simple enable or disable menu.
Change alpha 0 or 1.
Move the menu outside of canvas.
So what is better?
My second question is about static class.
Here is my sample code
if (dash)
{
Player.Instance.Speed = Player.Instance.DashSpeed;
Player.Instance.CurrentStamina -= 0.5f;
if (Player.Instance.CurrentStamina < 0)
Player.Instance.CurrentStamina = 0;
}
else
{
Player.Instance.Speed = speedCache;
Player.Instance.CurrentStamina += 1f;
if (Player.Instance.CurrentStamina >= Player.Instance.MaxStamina)
Player.Instance.CurrentStamina = Player.Instance.MaxStamina;
}
So, basically I constantly get;set; this variable from Player class, is it a bad?