using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using GCGame.Table; using Games.Events; using Games.LogicObj; using Games.ChatHistory; public class Obj_FellowHeadUI : Obj_HeadUI { public Slider GreenHpSlider; public Slider PurpleHpSlider; private Slider HpSlider; public static UIPathData pathData { get { return UIInfo.FellowHeadInfo; } } public override UIPathData uiPathData { get { return pathData; } } public Image m_HeadQuality; public ChatBubbleLogic m_ChatBubbleLogic; protected override bool HideByOption { get { return true; } } protected override void OnEnable() { base.OnEnable(); } public void SetHideHp(int state) { HpSliderShowLogic(state); } public void HpSliderShowLogic(int state) { GreenHpSlider.gameObject.SetActive(false); PurpleHpSlider.gameObject.SetActive(false); if (state <= 0) return; HpSlider = (state == 1 ? GreenHpSlider : PurpleHpSlider); if(HpSlider != null) { HpSlider.gameObject.SetActive(true); } } public void SetNewHp(float rate) { if(HpSlider != null) HpSlider.value = rate; } public void SetFellowQuilityIcon(int Quality) { if (m_HeadQuality != null) { LoadAssetBundle.Instance.SetImageSprite(m_HeadQuality, GCGame.Utils.GetFellowQuilityIcon(Quality)); } } public override void ShowChatBubble(ChatHistoryItem text) { if (null != m_ChatBubbleLogic) { m_ChatBubbleLogic.gameObject.SetActive(true); m_ChatBubbleLogic.Show(text); } } public override void HideChatBubble(bool state) { if (null != m_ChatBubbleLogic) { m_ChatBubbleLogic.gameObject.SetActive(state); } } }