Exemple #1
0
        public override void Exec()
        {
            //判断UI是否完成了动画显示
            hpPanel.SetActive(true);
            HPMPUIManager uiManager = hpPanel.GetComponent <HPMPUIManager>();

            if (uiManager.finished)
            {
                finished = true;
                uiManager.HideBar();
            }
            else
            {
                uiManager.HPMinus(minusNum);
            }
        }
Exemple #2
0
    private IEnumerator ShowCorrect(string entry)
    {
        //打开break
        breakContainer.SetActive(true);
        //纵向展开
        float y = 0;

        while (y < 1)
        {
            y = Mathf.MoveTowards(y, 1, 1 / 0.2f * Time.fixedDeltaTime);
            breakBackSprite.transform.localScale = new Vector3(1, y, 1);
            yield return(null);
        }
        //且解字显示
        float alpha = 0;

        while (alpha < 1)
        {
            alpha = Mathf.MoveTowards(alpha, 1, 1 / 0.2f * Time.fixedDeltaTime);
            breakLabel.GetComponent <UIRect>().alpha = alpha;
            yield return(null);
        }
        float scale = 1;

        while (scale < 1.1)
        {
            scale = Mathf.MoveTowards(scale, 1.1f, 0.1f / 0.8f * Time.fixedDeltaTime);
            breakLabel.transform.localScale = new Vector3(scale, scale, 1);
            yield return(null);
        }
        //同步消除 血条 问题
        hpmpManager.HideBar();
        StartCoroutine(CloseQuestion());
        while (alpha > 0)
        {
            alpha = Mathf.MoveTowards(alpha, 0, 1 / 0.3f * Time.fixedDeltaTime);
            breakLabel.GetComponent <UIRect>().alpha = alpha;
            breakBackSprite.transform.localScale     = new Vector3(1, alpha, 1);
            yield return(null);
        }
        //复原状态
        breakLabel.transform.localScale = new Vector3(1, 1, 1);
        breakContainer.SetActive(false);
        reasoningNode.ReasoningExit(entry);
    }
    private IEnumerator CloseUI()
    {
        currentLabel.transform.localPosition = originPosition;
        //禁用证据按钮
        SetEvidenceEnable(false);
        //隐藏血条
        hpmpManager.HideBar();
        //移出 证据框 进度条
        float x = 1;

        while (x > 0)
        {
            x = Mathf.MoveTowards(x, 0, 1 / 0.1f * Time.fixedDeltaTime);
            float eviy  = -440 + 150 * x;
            float timex = 670 - 70 * x;
            evidenceContainer.transform.localPosition = new Vector3(evidenceContainer.transform.localPosition.x, eviy, 0);
            timeObject.transform.localPosition        = new Vector3(timex, timeObject.transform.localPosition.y, 0);
            yield return(null);
        }
    }
    private IEnumerator CloseUI()
    {
        //禁用证据按钮
        SetEvidenceEnable(false);
        //隐藏血条
        hpmpManager.HideBar();
        //证词回预设位置
        currentLabel.transform.localPosition = originPosition;
        //移出证据栏和证词进度条
        float t     = 1;
        float speed = 1 / 0.1f * Time.deltaTime;

        while (t > 0)
        {
            t = Mathf.MoveTowards(t, 0, speed);
            float eviy  = EVIDENCE_Y + EVIDENCE_MOVE * t;
            float timex = TIME_X - TIME_MOVE * t;
            SetPositionX(timeObject, timex);
            SetPositionY(evidenceContainer, eviy);
            yield return(null);
        }
    }