Exemple #1
0
 private void ShowOutline(Boolean doHighlight, Color color)
 {
     color.a *= m_currentlyUsedOutlineSetting * m_currentlyUsedOutlineSetting;
     if (color.a > 0.001f)
     {
         OutlineGlowFX outlineGlowFX = GetComponent <OutlineGlowFX>();
         if (outlineGlowFX == null || outlineGlowFX.IsDestroyed)
         {
             outlineGlowFX = gameObject.AddComponent <OutlineGlowFX>();
             outlineGlowFX.SetGlobalIntensity(m_currentlyUsedOutlineSetting);
         }
         outlineGlowFX.ShowOutline(doHighlight, color);
     }
     else
     {
         HideOutline();
     }
 }
Exemple #2
0
 private void Update()
 {
     if (MyController != null && m_HPBar != null)
     {
         if (m_isDeadAnimationFinished || m_recentDamage.cachedTransform.localScale.x == 0f)
         {
             SetVisible(true);
             UIWidget[] componentsInChildren = m_HPBar.transform.parent.GetComponentsInChildren <UIWidget>();
             foreach (UIWidget uiwidget in componentsInChildren)
             {
                 uiwidget.alpha -= Time.deltaTime;
             }
             if (m_buffList.Count > 0)
             {
                 HelperBuffs.DestroyAllBuffViews(m_buffList, OnTooltipEvent);
             }
         }
         SetVisible(IsMonsterInFrontOfParty() || IsMonsterLastHitRecently());
         Vector3 localScale  = m_HPBar.cachedTransform.localScale;
         Vector3 localScale2 = m_recentDamage.cachedTransform.localScale;
         if (m_timeStartUpdateDamagebar == 0f && localScale.x != localScale2.x)
         {
             m_timeStartUpdateDamagebar = Time.time + 0.5f;
         }
         else if (Time.time > m_timeStartUpdateDamagebar)
         {
             Single num;
             if (Mathf.Abs(m_targetHPBarScaleX - localScale.x) < 0.001f)
             {
                 num = -1f;
             }
             else
             {
                 num = 1f;
             }
             Single num2 = Mathf.Sign(localScale.x - localScale2.x);
             localScale2.x += num2 * (m_initialSize * Time.deltaTime) * 0.5f;
             if (Mathf.Sign(localScale.x - localScale2.x) != num2)
             {
                 m_timeStartUpdateDamagebar = 0f;
                 if (num < 0f)
                 {
                     m_recentDamage.cachedTransform.localScale = localScale;
                 }
                 else
                 {
                     m_HPBar.cachedTransform.localScale = m_recentDamage.cachedTransform.localScale;
                 }
             }
             else if (num < 0f)
             {
                 m_recentDamage.cachedTransform.localScale = localScale2;
             }
             else
             {
                 localScale.x -= num2 * (m_initialSize * Time.deltaTime) * 0.5f;
                 m_HPBar.cachedTransform.localScale = localScale;
             }
         }
         if (m_currentlyUsedOutlineSetting != ConfigManager.Instance.Options.EnemyOutlineOpacity)
         {
             m_currentlyUsedOutlineSetting = ConfigManager.Instance.Options.EnemyOutlineOpacity;
             OutlineGlowFX component = GetComponent <OutlineGlowFX>();
             if (component != null && !component.IsDestroyed)
             {
                 component.SetGlobalIntensity(m_currentlyUsedOutlineSetting);
                 ShowOutline(false, m_selectedColor);
             }
             else if (LegacyLogic.Instance.WorldManager.Party.SelectedMonster == MyController)
             {
                 ShowSelection();
             }
         }
         if (LegacyLogic.Instance.ConversationManager.IsOpen)
         {
             SetVisible(false);
         }
     }
 }