Esempio n. 1
0
 public void RemoveFlashing(SmartEntity entity)
 {
     for (int i = this.flashingEntities.Count - 1; i >= 0; i--)
     {
         FlashingEntity flashingEntity = this.flashingEntities[i];
         if (flashingEntity.Entity == entity)
         {
             this.StopFlashing(i);
         }
     }
 }
Esempio n. 2
0
 public void OnViewFrameTime(float dt)
 {
     for (int i = this.flashingEntities.Count - 1; i >= 0; i--)
     {
         FlashingEntity flashingEntity = this.flashingEntities[i];
         if (flashingEntity.Flash(dt))
         {
             this.StopFlashing(i);
         }
     }
 }
Esempio n. 3
0
        public void RemoveFlashingFromAllEntities()
        {
            if (this.flashingEntities.Count == 0)
            {
                return;
            }
            int count = this.flashingEntities.Count;

            for (int i = 0; i < count; i++)
            {
                FlashingEntity flashingEntity = this.flashingEntities[i];
                flashingEntity.Complete();
            }
            this.flashingEntities.Clear();
            this.UnregisterObservers();
        }
Esempio n. 4
0
        private void StopFlashing(int i)
        {
            FlashingEntity flashingEntity = this.flashingEntities[i];

            flashingEntity.Complete();
            this.flashingEntities.RemoveAt(i);
            if (this.flashingEntities.Count == 0)
            {
                this.UnregisterObservers();
            }
            GameObjectViewComponent gameObjectViewComp = flashingEntity.Entity.GameObjectViewComp;

            if (gameObjectViewComp != null)
            {
                gameObjectViewComp.IsFlashing = false;
            }
        }
Esempio n. 5
0
        public void RemoveFlashing(SmartEntity entity)
        {
            bool flag = false;

            for (int i = this.flashingEntities.Count - 1; i >= 0; i--)
            {
                FlashingEntity flashingEntity = this.flashingEntities[i];
                if (flashingEntity.Entity == entity)
                {
                    flag = true;
                    this.StopFlashing(i);
                }
            }
            if (flag)
            {
                this.TrySendShaderResetOnEntityEvent();
            }
        }
Esempio n. 6
0
        public void OnViewFrameTime(float dt)
        {
            bool flag = false;

            for (int i = this.flashingEntities.Count - 1; i >= 0; i--)
            {
                FlashingEntity flashingEntity = this.flashingEntities[i];
                if (flashingEntity.Flash(dt))
                {
                    flag = true;
                    this.StopFlashing(i);
                }
            }
            if (flag)
            {
                this.TrySendShaderResetOnEntityEvent();
            }
        }
Esempio n. 7
0
        public void AddFlashing(SmartEntity entity, float flashDuration, float flashDelay)
        {
            GameObjectViewComponent gameObjectViewComp = entity.GameObjectViewComp;

            if (gameObjectViewComp == null)
            {
                return;
            }
            if (gameObjectViewComp.IsFlashing)
            {
                return;
            }
            gameObjectViewComp.IsFlashing = true;
            if (this.flashingEntities.Count == 0)
            {
                this.RegisterObservers();
            }
            FlashingEntity item = new FlashingEntity(entity, gameObjectViewComp.MainGameObject, flashDuration, flashDelay);

            this.flashingEntities.Add(item);
        }