static void LoadPlayerPreferences(GameManager manager) { m_nameFormat = UserPrefs.GetNameFormat(); m_healthManaFormat = UserPrefs.GetHealthManaFormat(); manager.UpdatePlayerNameFormat(); manager.UpdatePlayerHealthManaFormat(); }
public void UpdateHealthManaVisibility() { bool isActive = IsPlayerVisible(); if (isActive) { HealthManaFormat healthManaFormat = ClientManager.GetHealthManaFormat(); switch (healthManaFormat) { case HealthManaFormat.Hidden: isActive = false; break; case HealthManaFormat.VisibleOnUpdate: if (playerHP == 100 && (playerMP == 100 || playerMP == 0) && hpMpCoroutine == null) { isActive = false; } break; } } statBarObject.gameObject.SetActive(isActive); }
public static void SwitchHealthManaFormat() { m_healthManaFormat = UserPrefs.GetNextHealthManaFormat(m_healthManaFormat); UserPrefs.Save(); foreach (GameManager manager in m_gameManagers) { switch (m_healthManaFormat) { case HealthManaFormat.Hidden: manager.AddColorChatMessage(7, "Player vitality bars are now hidden."); break; case HealthManaFormat.VisibleOnUpdate: manager.AddColorChatMessage(7, "Player vitality bars are being shown when updated."); break; case HealthManaFormat.Visible: manager.AddColorChatMessage(7, "Player vitality bars are now visible."); break; } manager.UpdatePlayerHealthManaFormat(); } }
public static HealthManaFormat GetNextHealthManaFormat(HealthManaFormat healthManaFormat) { return(GetNextUserPrefEnumValue <HealthManaFormat>("PlayerState-HealthManaFormat", healthManaFormat)); }