Esempio n. 1
0
        public static PlayerHPChangeEventArgs Create(int lastHP, int currentHP, object userData = null)
        {
            PlayerHPChangeEventArgs playerHPChangeEventArgs = ReferencePool.Acquire <PlayerHPChangeEventArgs>();

            playerHPChangeEventArgs.LastHP    = lastHP;
            playerHPChangeEventArgs.CurrentHP = currentHP;
            return(playerHPChangeEventArgs);
        }
        private void OnPlayerHPChange(object sender, GameEventArgs e)
        {
            PlayerHPChangeEventArgs ne = (PlayerHPChangeEventArgs)e;

            if (ne == null)
            {
                return;
            }

            hpText.text = ne.CurrentHP.ToString();
        }