Пример #1
0
        void Update()
        {
            if (_caughtFire)
            {
                _burnTimer += Time.deltaTime;

                _burnRadius.radius += _expandRate * Time.deltaTime;

                if (_burnTimer >= _burnUpDuration)
                {
                    FinishBurning();
                }

                var nearbyFlammables = PhysicsUtils.GetOverlappingFlammables(_burnRadius);

                foreach (var flammable in nearbyFlammables)
                {
                    flammable.HeatUp();
                }
            }

            if (!_burnt)
            {
                _spriteRenderer.color = new Color(1f, 1f - HeatPercentage, 1f - HeatPercentage);
            }
            else
            {
                _spriteRenderer.color = Color.black;
            }
        }
Пример #2
0
 protected override void ProgressUpdate()
 {
     _flammables = PhysicsUtils.GetOverlappingFlammables(_targetCollider);
     _flammables = _flammables.Where(x => x.CaughtFire).ToList();
 }