を果たしていないため。..スクリプトカウントダウンタイマーを設定し、キャンバスはユニティ
ここではゲームプレイの画面やよりよい理解のためのスクリプトは次のとおりです。
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class playGameAgainScript : MonoBehaviour {
//Use this for Timer
public Text countDown;
private float timer = 60;
//Declare Button
public Button playAgainButton;
void Start() {
//Set countDown value
countDown = GetComponent<Text>();
}
void Update() {
timer -= Time.deltaTime;
countDown.text = "" + timer.ToString ("f0");
if (timer <= 0) {
timer = 0;
playAgainButton.gameObject.SetActive (true);
}
}
public void PlayAgain() {
UnityEngine.SceneManagement.SceneManager.LoadScene ("Main Scene");
}
}
`
なぜボタンコンポーネントとEventTriggerがあるのですか?あなたのキャンバスにはGraphicsRaycasterがありますか? –
私はPointerEnter機能が必要なので、はい、キャンバスにはGraphicsRaycasterがあります。 –