Exemple #1
0
        protected override void OnDeath()
        {
            PositionTracker.StopTracking(this);

            _collider.OnDamageTaken    -= ApplyDamage;
            _collider.OnItemsCollected -= AddCollectedItems;

            _hands.OnPowerGained -= FillSegment;
            _hands.OnPowerLost   -= EmptySegment;

            var spawnedItem = ItemLoader.CreateItem(Items.ItemActors.ItemActorTypes.HealthPack, Position);
            var chunk       = GameManager.World.ChunkArchitect.GetContainingChunk(Position);

            chunk.Register(spawnedItem);

            if (_regenerationCoroutine != null)
            {
                StopCoroutine(_regenerationCoroutine);
                _regenerationCoroutine = null;
            }

            Destroy(_collider);
        }
Exemple #2
0
 protected override void OnWorldObjectUnloaded()
 {
     PositionTracker.StopTracking(this);
 }
Exemple #3
0
 protected override void OnWorldObjectDestroy()
 {
     PositionTracker.StopTracking(this);
 }