Пример #1
0
    protected override void HandleDelayContext()
    {
        base.HandleDelayContext();
        BaseBattleItem item = portraitMode ? m_portraitItem : m_normalItem;

        item.contentText.text = moduleStory.GetReplaceContent();
    }
Пример #2
0
    public void UpdateBattleCache(Creature monster, BaseBattleItem item)
    {
        if (monster == null)
        {
            Logger.LogError("battle item update error,talking monster is null");
            return;
        }

        if (!m_battleStoryDic.ContainsKey(monster))
        {
            m_battleStoryDic.Add(monster, null);
        }
        m_battleStoryDic[monster] = item;

        if (item != null)
        {
            if (m_scalerFactor == 0f)
            {
                CanvasScaler cs = UIManager.canvasScaler;
                m_scalerFactor = cs.matchWidthOrHeight == 1 ? cs.referenceResolution.y / Screen.height : cs.referenceResolution.x / Screen.width;

                var ss = new Vector2(Screen.width * m_scalerFactor, Screen.height * m_scalerFactor);
                m_screenRect = new Rect(-ss.x * 0.5f, -ss.y * 0.5f, ss.x, ss.y);
            }
        }

        enableUpdate = m_battleStoryDic.Count > 0;
        UpdateBattleItemPos();
    }
Пример #3
0
    protected override void InitComponent()
    {
        base.InitComponent();

        Transform t = transform.Find("panel_scenario/panel_withoutportrait");

        m_normalItem     = new BaseBattleItem(t);
        t                = transform.Find("panel_scenario/panel_withportrait");
        m_portraitItem   = new PortraitBattleItem(t);
        m_maskObj        = transform.Find("mask").gameObject;
        m_fastForwardBtn = transform.GetComponent <Button>("fast_forward_btn");
        m_fastForwardBtn.SafeSetActive(false);
        m_normalBtn = transform.GetComponent <Button>("normalplay_btn");
        m_normalBtn?.gameObject.SetActive(false);

        Text text = m_fastForwardBtn?.transform.GetComponent <Text>("Text");

        if (text)
        {
            text.text = ConfigText.GetDefalutString(TextForMatType.StoryUIText, 0);
        }
        text = m_normalBtn?.transform.GetComponent <Text>("Text");
        if (text)
        {
            text.text = ConfigText.GetDefalutString(TextForMatType.StoryUIText, 1);
        }

        ResetAllItems();
        moduleStory.ClearBattleCache();
        moduleStory.SetSwitchPointCamera(Level.current == null ? Camera.main : Level.current.mainCamera, UIManager.worldCamera);
    }
Пример #4
0
    protected override void HandleDelayContext()
    {
        base.HandleDelayContext();
        BaseBattleItem item = portraitMode ? m_portraitItem : m_normalItem;

        m_currentText      = item.contentText;
        m_currentText.text = string.Empty;
        DoContentTextAnim(m_currentText, moduleStory.GetReplaceContent());
    }
Пример #5
0
    protected override void CheckCanChangeToNext()
    {
        base.CheckCanChangeToNext();
        bool           isEnded = m_contextStep == EnumContextStep.End;
        BaseBattleItem item    = portraitMode ? m_portraitItem : m_normalItem;

        item.arrowTrans.gameObject.SetActive(isEnded);
        CheckAutoNextDialog();
    }
Пример #6
0
    protected void UpdateStoryAndMonster(bool portrait)
    {
        if (m_tempFindedMonster == null)
        {
            Logger.LogError("{2} : [battle] storyInfo id = {0} index = {1} connot find the taking roles ", storyId, curStoryItemIndex, Time.time);
            return;
        }

        BaseBattleItem item = portrait ? m_portraitItem : m_normalItem;

        item.SetPanelVisible(true);
        item.ResetItem();
        string monstername = string.Empty;

        if (m_tempFindedMonster is MonsterCreature)
        {
            monstername = (m_tempFindedMonster as MonsterCreature).monsterInfo.name;
        }
        item.nameText.text = storyItem.needReplaceName ? moduleStory.GetReplaceName() : monstername;
        //item.DoDialogBgTween();
        moduleStory.UpdateBattleCache(m_tempFindedMonster, item);
    }