[過去ログ] 【ゲームエンジン】Unity初心者質問スレBuild4 (1002レス)
1-

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
424
(1): 423 2020/05/12(火)15:39 ID:oz8b1+GC(2/5) AAS
//■■■Booleanに付けたスクリプト■■
using UnityEngine;
public class Boolean : MonoBehaviour
{
public bool BOOL = false;

void Update()
{Debug.Log(BOOL);}
}

//■■■Buttonのクリックイベント■■
using UnityEngine;

public class Button : MonoBehaviour
{
bool BOOL;
public void Click()//ボタンのクリックイベント
{
BOOL = GameObject.Find("Boolean").GetComponent<Boolean>().BOOL;

if (BOOL == false)
{BOOL = true;}

else
{BOOL = false;}
}
}

ボタンを押してもDebug.Log(BOOL) が true にならないです。
Booleanの中のboolean型の変数 を true にしたいのでどうか教えてください。
1-
あと 578 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.012s