Esempio n. 1
0
    void Update()
    {
        if (!gameover)
        {
            rb.velocity = new Vector2(run * speed, rb.velocity.y);

            if (events.point == 3)
            {
                run = 1f;
            }

            if (this.transform.position.x > 7)
            {
                events.MoveAnimation(a);
                Destroy(this.gameObject);
            }
        }
    }
Esempio n. 2
0
    void Update()
    {
        // 文章の表示完了
        if (IsDisplayComplete())
        {
            if (one)
            {
                Instantiate(clickIconObj);
                one = false;
            }

            //最後の文章ではない & ボタンが押された
            if (currentSentenceNum < sentences.Length &&
                Input.GetMouseButton(0) &&
                GameObject.FindWithTag("ClickIcon") == true)
            {
                SetNextSentence();
                events.MoveAnimation(a);
                one = true;
            }
        }

        //表示される文字数を計算
        int displayCharCount = (int)(Mathf.Clamp01((Time.time - timeBeganDisplay) / timeUntilDisplay) * currentSentence.Length);

        //表示される文字数が表示している文字数と違う
        if (displayCharCount != lastUpdateCharCount)
        {
            uiText.text = currentSentence.Substring(0, displayCharCount);
            //表示している文字数の更新
            lastUpdateCharCount = displayCharCount;
        }

        //最後の文章が来たら次は文章を削除
        if (currentSentenceNum == sentences.Length)
        {
            Destroy(gameObject);
        }
    }
Esempio n. 3
0
    bool one = true;                                // clickIconObj(Clone)用

    void Start()
    {
        SetNextSentence();
        events = FindObjectOfType <GameEvents2_Allo>();
        events.MoveAnimation(a);
    }