Esempio n. 1
0
        [SerializeField] private Explosion _deathExplosion;                 // Explosion that will be created after unit death.

        #endregion

        private void Awake()
        {
            _health = new BehaviorSubject <float>(_startingHealth);
            _health.DoOnCompleted(OnDeath);
            _health.Subscribe(_ => { }, OnDeath);
            HealthPercentageStream = _health.Select(currentHealth => currentHealth / _startingHealth);
        }