Exemplo n.º 1
0
        private void Update()
        {
            if (!Playing)
            {
                return;
            }

            playerEntities.RemoveAll(delegate(MovableEntity entity) {
                var pos = entity.transform.position;
                if (pos.y <= DeathHeight)
                {
                    entity.gameObject.SetActive(false);
                    deadEntities.Add(entity);
                    DeathEffect.ExecuteIfPresent(pos);
                    CameraController.Instance.SearchTargets();
                    return(true);
                }

                return(false);
            });
            if (playerEntities.Count == 1)
            {
                End(playerEntities.First());
            }
        }
 public void Shoot(Vector3 dir, float force)
 {
     _rb.velocity = Vector3.zero;
     _rb.AddForce(dir * force, ForceMode.Impulse);
     _rb.AddTorque(Random.insideUnitSphere * force, ForceMode.Impulse);
     ShootEffect.ExecuteIfPresent(transform.position);
 }
Exemplo n.º 3
0
        private IEnumerator EndRoutine(MovableEntity winner)
        {
            VictoryEffect.ExecuteIfPresent(winner.transform.position);
            Playing = false;
            yield return(new WaitForSeconds(WaitDuration));

            EndPanel.Show();
            ToSelectOnEnd.Select();
            //SetInputMaps(true);
        }
    private void OnCollisionEnter(Collision other)
    {
        _pool.SpawnFromPool("LaserExplosion", transform.position, Quaternion.identity);

        var selection = Selections.SphereSelection(World.Instance, transform.position.ToVector3Int(), DestructionArea);

        selection.DeleteAll();
        HitEffect.ExecuteIfPresent(transform.position);
        gameObject.SetActive(false);
    }