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); } }
void DinasourTalk() { if (events.point == 1) { state = "ANGRY"; } if (events.point == 2) { state = "STOP"; } if (events.point == 4) { state = "TALK"; } if (events.point == 5) { state = "ANGRY"; } if (events.point == 6) { state = "STOP"; } if (events.point == 7) { state = "WALK"; run = 1; if (this.transform.position.x > 1.1) { events.MoveAnimation(a); } } if (events.point == 8) { Destroy(this.gameObject); } }
bool one = true; // clickIconObj(Clone)用 void Start() { SetNextSentence(); events = FindObjectOfType <GameStart_Allo>(); events.MoveAnimation(a); }