예제 #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);
         }
     }
 }
예제 #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);
         }
     }
 }
예제 #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();
        }
예제 #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;
            }
        }
예제 #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();
            }
        }
예제 #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();
            }
        }
예제 #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);
        }