unityでゲームを作っていたら、Cannot implicitly convert type 'string' to 'Item.ItemType'というエラーが出てしまいました。googleで調べましたが解決法がどうしてもわかりません。もしこのエラーがわかる方はぜひご教授願いたいです
public class Door : MonoBehaviour
{
private SphereCollider scol; // Start is called before the first frame update void Start() { scol = GetComponent<SphereCollider>(); } ///<param name="type"></param>param> void Update(Item.ItemType type ) { ///string type = type.ToString; if (type = "Key1") { Debug.Log(type); } } ///public void OnTriggerEnter(Collider other) ///{ ///if (item.ItemType.type = "Key1") ///{ ///} ///}
}
こちらの質問が複数のユーザーから「調査したこと・試したことが記載されていない質問」という指摘を受けました。
回答1件