Esempio n. 1
0
        public static void Add(ContextSprite sprite)
        {
            HashSet <ContextSprite> contextSprites;

            ContextSprite.g.visible.Add(sprite);
            ContextSprite.g.count = ContextSprite.g.count + 1;
            if (!ContextSprite.g.requestableVisibleSprites.TryGetValue(sprite.contextRequestable, out contextSprites))
            {
                contextSprites = (ContextSprite.g.hashRecycle.Count <= 0 ? new HashSet <ContextSprite>() : ContextSprite.g.hashRecycle.Dequeue());
                ContextSprite.g.requestableVisibleSprites[sprite.contextRequestable] = contextSprites;
            }
            contextSprites.Add(sprite);
            if (ContextSprite.CalculateFadeOut(ref sprite.fade, Time.time - sprite.timeRemoved))
            {
                sprite.UpdateMaterialProperties();
            }
        }
Esempio n. 2
0
 private static bool CalculateFadeDim(ref double fade, float elapsed)
 {
     if (fade < 0.15)
     {
         if (ContextSprite.CalculateFadeIn(ref fade, elapsed))
         {
             if (fade > 0.15)
             {
                 fade = 0.15;
             }
             return(true);
         }
     }
     else if (fade > 0.15 && ContextSprite.CalculateFadeOut(ref fade, elapsed))
     {
         if (fade < 0.15)
         {
             fade = 0.15;
         }
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
        public static void Step(Camera camera)
        {
            float              single;
            RaycastHit         raycastHit;
            bool               flag;
            ContextSprite      contextSprite = null;
            ContextStatusFlags contextStatusFlag;
            bool               flag1;

            if (ContextSprite.g.count > 0)
            {
                single = Time.deltaTime;
                if (single <= 0f)
                {
                    return;
                }
                int num = 525313;
                if (!RPOS.hideSprites)
                {
Label2:
                    foreach (ContextSprite contextSprite in ContextSprite.g.visible)
                    {
                        if (!contextSprite.requestableHasStatus)
                        {
                            flag = false;
                        }
                        else
                        {
                            contextStatusFlag = contextSprite.requestableStatus.ContextStatusPoll() & (ContextStatusFlags.SpriteFlag0 | ContextStatusFlags.SpriteFlag1);
                            if ((int)contextStatusFlag != 0)
                            {
                                if (contextStatusFlag != ContextStatusFlags.SpriteFlag0)
                                {
                                    goto Label1;
                                }
                                flag = true;
                                goto Label0;
                            }
Label3:
                            flag = false;
Label0:
                        }
                        Vector3 vector3  = contextSprite.transform.position;
                        Ray     ray      = camera.ScreenPointToRay(camera.WorldToScreenPoint(vector3));
                        Vector3 vector31 = ray.direction;
                        Vector3 vector32 = ray.origin;
                        float   single1  = vector3.x * vector31.x + vector3.y * vector31.y + vector3.z * vector31.z - (vector32.x * vector31.x + vector32.y * vector31.y + vector32.z * vector31.z);
                        if (single1 <= 0f || ContextSprite.g.PhysRaycast(ref ray, out raycastHit, single1, num) && !contextSprite.IsSeeThrough(ref raycastHit))
                        {
                            flag1 = ContextSprite.CalculateFadeOut(ref contextSprite.fade, single);
                        }
                        else
                        {
                            flag1 = (!flag ? ContextSprite.CalculateFadeIn(ref contextSprite.fade, single) : ContextSprite.CalculateFadeDim(ref contextSprite.fade, single));
                        }
                        if (!flag1)
                        {
                            continue;
                        }
                        contextSprite.UpdateMaterialProperties();
                    }
                }
                else
                {
                    foreach (ContextSprite contextSprite1 in ContextSprite.g.visible)
                    {
                        if (!ContextSprite.CalculateFadeOut(ref contextSprite1.fade, single))
                        {
                            continue;
                        }
                        contextSprite1.UpdateMaterialProperties();
                    }
                }
            }
            return;

            if (contextStatusFlag == ContextStatusFlags.SpriteFlag1)
            {
                if (ContextSprite.CalculateFadeOut(ref contextSprite.fade, single))
                {
                    contextSprite.UpdateMaterialProperties();
                }
                goto Label2;
            }
            else if (contextStatusFlag == (ContextStatusFlags.SpriteFlag0 | ContextStatusFlags.SpriteFlag1))
            {
                if (ContextSprite.CalculateFadeIn(ref contextSprite.fade, single))
                {
                    contextSprite.UpdateMaterialProperties();
                }
                goto Label2;
            }
            else
            {
                goto Label3;
            }
        }