初めて質問させていただきます。
Unityでクリックしたらタイマーが動くようにしたいのですが、
if文の中にタイマー開始スクリプトを入れたら、ずっとクリックしないとタイマーが動ごかなくなってしまいました。
つまりifの中をずっと繰り返ししたいということです。どうすればよろしいでしょうか。
ぜひ、ご教授願います。
該当のソースコード
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Kieusero : MonoBehaviour { float countTime = 0; // Start is called before the first frame update void Start() { } // Update is called once per frame private void Update() { if (Input.GetMouseButtonDown(0) == true) { Destroy(this.gameObject); } } }
試したこと
ifの中にupped関数を入れようとしましたが入れれませんでした
補足情報(FW/ツールのバージョンなど)
Unity 2019.1.14f1
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/04/15 11:31