void Update() { rb.velocity = new Vector2(rb.velocity.x, run * speed); SelectAnimation(); // 立ち止まる if (this.transform.position.y > 0) { run = 0f; state = "STOP"; octavian.playerArrive = true; if (one) { startMove.MoveAnimation(a); one = false; } if (catch1) { state = "HELPME"; if (two) { serif = FindObjectOfType <Serif_PlayStart2>(); serif.NextText = true; two = false; } run = -1f; speed = 2f; } } if (this.transform.position.y < -7) { Destroy(this.gameObject); } if (startMove.point == 3) { state = "TALK"; } if (startMove.point >= 4 && startMove.point <= 7) { state = "STOP"; } if (startMove.point == 8) { state = "TALK"; } }
void Update() { // 文章の表示完了 if (IsDisplayComplete()) { if (one && clickOK) { Instantiate(clickIconObj); one = false; } //最後の文章ではない & ボタンが押された if (currentSentenceNum < sentences.Length && Input.GetMouseButton(0) && GameObject.FindWithTag("ClickIcon") == true || NextText) { NextText = false; SetNextSentence(); startMove.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); } }