refactoring again
This commit is contained in:
@@ -64,11 +64,7 @@ namespace UntitledLogicGame.Workspace
|
||||
// Update is called once per frame
|
||||
private void Update()
|
||||
{
|
||||
if (_lastActivated == null || _lastActivated != Activated)
|
||||
{
|
||||
_sprite.color = Activated ? GameManager.Instance.ActivatedColor : GameManager.Instance.DeadColor;
|
||||
_lastActivated = Activated;
|
||||
}
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
private void OnMouseEnter()
|
||||
@@ -110,6 +106,15 @@ namespace UntitledLogicGame.Workspace
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void UpdateState()
|
||||
{
|
||||
if (_lastActivated == null || _lastActivated != Activated)
|
||||
{
|
||||
_sprite.color = Activated ? GameManager.Instance.ActivatedColor : GameManager.Instance.DeadColor;
|
||||
_lastActivated = Activated;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user