Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タイトルはそれをすべて説明しています。別のスクリプトから変数にアクセスする方法を知りたいです。オンラインで検索しましたが、機能するものは何も見つかりませんでした。
まず、変数をパブリックにする必要があります。次に、GameObject を取得し、Componend を取得して、変数にアクセスします。
var variable = GameObject.Find("name").GetComponent<ScriptClass>().yourVariable;