Esempio n. 1
0
        private void SetTalkPanelType(string type)
        {
            int typeID = Int32.Parse(type);

            var config = TalkPanelConfig.GetConfigByKey(typeID);

            if (config == null)
            {
                SetActionState(ActionState.End);
                return;
            }
            StoryController.SetTalkPanelType(typeID);

            PrefabManager.Instance.SetImage(m_img_content_Image, config.contentBG);
            PrefabManager.Instance.SetImage(m_img_contentEnd_Image, config.contentEndImg);
            PrefabManager.Instance.SetImage(m_img_nameBG_Image, config.nameBG);
            PrefabManager.Instance.SetImage(m_btn_auto_Image, config.autoBtnBG);
            PrefabManager.Instance.SetImage(m_btn_history_Image, config.historyBtnBG);
            if (!string.IsNullOrEmpty(config.talkBG))
            {
                m_img_talkBG_Image.gameObject.SetActive(true);
                PrefabManager.Instance.SetImage(m_img_talkBG_Image, config.talkBG);
            }
            else
            {
                m_img_talkBG_Image.gameObject.SetActive(false);
            }
            SetActionState(ActionState.End);
        }
Esempio n. 2
0
        private void SetTalkPanelType()
        {
            var type = UiDataProvider.ControllerManager.StoryController.GetTalkPanelType();

            if (m_uiType == type)
            {
                return;
            }

            m_uiType = type;
            var config = TalkPanelConfig.GetConfigByKey(type);

            if (config == null)
            {
                return;
            }
            PrefabManager.Instance.SetImage(m_btn_history_Image, config.historyBtnBG);
        }
Esempio n. 3
0
        private void RefreshUIType(int uiType)
        {
            if (m_type == uiType)
            {
                return;
            }
            m_type = uiType;
            var config = TalkPanelConfig.GetConfigByKey(uiType);

            if (config == null)
            {
                return;
            }
            PrefabManager.Instance.SetImage(m_bg, config.optionUnSelectedBG);
            PrefabManager.Instance.LoadAssetAsync <Sprite>(config.optionSelectedBG, (result) =>
            {
                if (result.status != RequestStatus.FAIL)
                {
                    var sprite = result.result as Sprite;
                    SpriteState spriteState   = m_btn.spriteState;
                    spriteState.pressedSprite = sprite;
                    m_btn.spriteState         = spriteState;
                }
            });
            PrefabManager.Instance.LoadAssetAsync <Sprite>(config.optionHoverBG, (result) =>
            {
                if (result.status != RequestStatus.FAIL)
                {
                    var sprite = result.result as Sprite;
                    SpriteState spriteState       = m_btn.spriteState;
                    spriteState.selectedSprite    = sprite;
                    spriteState.highlightedSprite = sprite;
                    m_btn.spriteState             = spriteState;
                }
            });
            Color newColor;

            if (ColorUtility.TryParseHtmlString(config.optionTextColor, out newColor))
            {
                m_content.color = newColor;
            }
        }