Ejemplo n.º 1
0
        void StopEnemyOnDeath(int targetID)
        {
            EnemyEntityView entityView = entityViewsDB.QueryEntityView <EnemyEntityView>(targetID);

            entityView.movementComponent.navMeshEnabled      = false;
            entityView.movementComponent.setCapsuleAsTrigger = true;
            entityView.rigidBodyComponent.isKinematic        = true;
        }
Ejemplo n.º 2
0
        IEnumerator Sink(EnemyEntityView entity, float sinkSpeed)
        {
            DateTime afterTwoSec = DateTime.UtcNow.AddSeconds(2);

            while (DateTime.UtcNow < afterTwoSec)
            {
                entity.transformComponent.position += -Vector3.up * sinkSpeed * Time.deltaTime;

                yield return(null);
            }

            entity.destroyComponent.destroyed.value = true;
        }