現在、Unityを用いてネットワーク通信を試すプログラムを作成しようとしていて、色んなサイトを漁っているのですが、どうしても分からないバグがあったので質問させていただきました。
C#
1using UnityEngine; 2using System.Collections; 3 4public class Pen : MonoBehaviour { 5 6 // Use this for initialization 7 void Start () { 8 9 } 10 11 // Update is called once per frame 12 void Update () 13 { 14 Vector3 pos = transform.position; 15 if (NetworkView.isMine) 16 { 17 if (Input.GetKey ("right")) 18 { 19 pos.x += 0.2f; 20 transform.position = pos; 21 } 22 else if (Input.GetKey ("left")) 23 { 24 pos.x -= 0.2f; 25 transform.position = pos; 26 } 27 } 28 } 29}
これをコンパイルしたら以下のエラーが出てきます
静的でないフィールド、メソッド、またはプロパティ'UnityEngine.NetworkView.isMine.get'で、オブジェクト参照が必要です。という表記が出てきます。
調べてみてもどこに悪い部分があるのかよくわかりません
一体何がダメなんでしょうか・・・
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。