コード例 #1
0
 private void HideHpBar()
 {
     if (entityHPBar)
     {
         GameEntry.Event.Fire(this, HideEntityInLevelEventArgs.Create(entityHPBar.Id));
         loadedHPBar = false;
         entityHPBar = null;
     }
 }
コード例 #2
0
 private void RemoveSlowEffect()
 {
     if (slowDownEffect != null)
     {
         GameEntry.Event.Fire(this, HideEntityInLevelEventArgs.Create(slowDownEffect.Id));
         slowDownEffect     = null;
         loadSlowDownEffect = false;
     }
 }
        protected override void OnUpdate(float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(elapseSeconds, realElapseSeconds);

            if (pause)
            {
                return;
            }

            timer += elapseSeconds;

            if (timer > hideTime)
            {
                GameEntry.Event.Fire(this, HideEntityInLevelEventArgs.Create(Entity.Id));
            }
        }
        protected override void OnUpdate(float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(elapseSeconds, realElapseSeconds);

            if (pause)
            {
                return;
            }

            timer += elapseSeconds;

            if (transform.position.y < yDestroyPoint || timer > selfDestroyTime)
            {
                if (!hide)
                {
                    GameEntry.Event.Fire(this, HideEntityInLevelEventArgs.Create(Entity.Id));
                    hide = true;
                }

                //GameEntry.Data.GetData<DataLevel>().CurrentLevel.EntityLoader.HideEntity(Entity.Id);
            }
        }
        void OnTriggerEnter(Collider other)
        {
            EntityEnemy enemy = other.gameObject.GetComponent <EntityEnemy>();

            if (enemy == null)
            {
                return;
            }

            if (!enemy.IsDead)
            {
                enemy.Damage(entityDataProjectile.ProjectileData.Damage);
            }

            int number = Physics.OverlapSphereNonAlloc(transform.position, entityDataProjectile.ProjectileData.SplashRange, s_Enemies, mask);

            for (int index = 0; index < number; index++)
            {
                Collider collider   = s_Enemies[index];
                var      rangeEnemy = collider.GetComponent <EntityEnemy>();
                if (rangeEnemy == null)
                {
                    continue;
                }
                if (!enemy.IsDead)
                {
                    rangeEnemy.Damage(entityDataProjectile.ProjectileData.SplashDamage);
                }
            }

            SpawnCollisionParticles();

            if (!hide)
            {
                GameEntry.Event.Fire(this, HideEntityInLevelEventArgs.Create(Entity.Id));
                hide = true;
            }
        }