コード例 #1
0
 private void Awake()
 {
     // Ensure the object persists through the lifetime of the game
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #2
0
    public override bool Damage(float dmg)
    {
        // For now do not take damage while ulting
        if (PlayerStats.UltEnabled)
        {
            return(false);
        }

        PlayerStats.CurrentHealth -= (int)dmg;
        PlayerHudManager.Instance.UpdateHealthUI(PlayerNumber, PlayerStats.CurrentHealth, PlayerStats.MaxHealth);
        if (PlayerStats.CurrentHealth <= 0)
        {
            GameMasterV2.KillPlayer(this);
        }
        else
        {
            ActivateFlash();
        }
        return(false);
    }