前提・実現したいこと
エラーを解決するためにインスペクターで設定をしたいのですがインスペクターに表示されません。
発生している問題・エラーメッセージ
ray11111.cs(41,39): error CS0246: The type or namespace name 'MoveWall' could not be found (are you missing a using directive or an assembly reference?)
該当のソースコード
c#
1using UnityEngine; 2using System.Collections; 3using TMPro; 4 5public class ray11111 : MonoBehaviour 6{ 7 //public string cubeTag = "Cube"; 8 //public string respawnTag = "Respawn"; 9 10 public string yestag = "YES"; 11 12 public string notag = "NO"; 13 14 //public GameObject Sphere; 15 16 public GameObject Wall; 17 18 //public TextMeshPro Count; 19 20 // Update is called once per frame 21 void Update() 22 { 23 if (Input.GetMouseButtonDown(0)) 24 { 25 Ray ray = new Ray(); 26 RaycastHit hit = new RaycastHit(); 27 ray = Camera.main.ScreenPointToRay(Input.mousePosition); 28 29 //マウスクリックした場所からRayを飛ばし、オブジェクトがあればtrue 30 if (Physics.Raycast(ray.origin, ray.direction, out hit, Mathf.Infinity)) 31 { 32 33 if (hit.collider.gameObject.CompareTag(yestag)) 34 { 35 Wall.GetComponent<MoveWall>().collect(); 36 } 37 if (hit.collider.gameObject.CompareTag(notag)) 38 { 39 //Sphere.GetComponent<Cube>().uncollect(); 40 Count.GetComponent<Count>().miss(); 41 Wall.GetComponent<MoveWall>().collect(); 42 } 43 44 // Debug.DrawRay(ray.origin, ray.direction * 30.0f, Color.red, 5); 45 } 46 } 47 } 48 49} 50
試したこと
[SerializedField]を追加しましたが何も変わりませんでした。
補足情報(FW/ツールのバージョンなど)
unity2019.4.11f1
windows10
回答1件
あなたの回答
tips
プレビュー