Example #1
0
 private void OnDestroy()
 {
     if (!MenuMain.exitingToMenu)
     {
         OverlayIconManager.Unregister(this);
     }
 }
Example #2
0
            public void Update(bool checkGroup, float breakGroupExpandDuration)
            {
                bool flag  = LocalPlayer.Inventory && LocalPlayer.Inventory.CurrentView == PlayerInventory.PlayerViews.World && Scene.Atmosphere;
                bool flag2 = PlayerPreferences.ShowOverlayIcons && flag;

                for (int i = 0; i < this._iconGroups.Count; i++)
                {
                    if (this._iconGroups[i].BreakGroupAlpha < 1f)
                    {
                        this._iconGroups[i].BreakGroupAlpha = Mathf.Clamp01(this._iconGroups[i].BreakGroupAlpha + Time.deltaTime / breakGroupExpandDuration);
                    }
                }
                for (int j = 0; j < this._iconSuperGroups.Count; j++)
                {
                    if (this._iconSuperGroups[j].BreakSuperGroupAlpha < 1f)
                    {
                        this._iconSuperGroups[j].BreakSuperGroupAlpha = Mathf.Clamp01(this._iconSuperGroups[j].BreakSuperGroupAlpha + Time.deltaTime / breakGroupExpandDuration);
                    }
                }
                for (int k = 0; k < this._icons.Count; k++)
                {
                    OverlayIcon overlayIcon = this._icons[k];
                    bool        flag3       = flag2;
                    if (flag2)
                    {
                        flag3 = (overlayIcon.IgnoreInCaveStatus || LocalPlayer.IsInCaves == overlayIcon.IsInCaves);
                    }
                    if (checkGroup && flag3)
                    {
                        if (overlayIcon.GroupDisplay)
                        {
                            flag3 = (overlayIcon.SuperGroupDisplay || overlayIcon.CurrentSuperGroup.BreakSuperGroup);
                        }
                        else if (overlayIcon.CurrentGroup.SuperGroupDisplay)
                        {
                            flag3 = (overlayIcon.CurrentGroup.BreakSuperGroup && overlayIcon.CurrentGroup.BreakGroup);
                        }
                        else
                        {
                            flag3 = (overlayIcon.CurrentGroup.CurrentSuperGroup.BreakSuperGroup && overlayIcon.CurrentGroup.BreakGroup);
                        }
                    }
                    if (flag3 && overlayIcon.ShouldRefreshTargetPosition)
                    {
                        if (!overlayIcon.target)
                        {
                            OverlayIconManager.Unregister(overlayIcon);
                            return;
                        }
                        overlayIcon.FinalTargetPosition = overlayIcon.target.position;
                    }
                    if (flag3 || overlayIcon._showing != flag3)
                    {
                        overlayIcon.DoUpdate(flag3, checkGroup);
                    }
                }
            }
Example #3
0
 public void SetSubType(int subtype)
 {
     if (this._subtype != subtype)
     {
         if (this.ID == 0)
         {
             this.ID = OverlayIconManager.GetNewId();
             Vector3 worldPosition = (!this.target) ? ((!base.transform.parent) ? base.transform.position : base.transform.parent.position) : this.target.position;
             float   num           = Terrain.activeTerrain.SampleHeight(worldPosition) + Terrain.activeTerrain.transform.position.y - 3f;
             this.IsInCaves = (worldPosition.y < num);
         }
         OverlayIconManager.Unregister(this);
         this._subtype = subtype;
         OverlayIconManager.Register(this);
     }
 }