前提・実現したいこと
BodySourceViewスクリプト内の変数vを、FirstPersonControllerで呼び出したい。
ここに質問の内容を詳しく書いてください。
コンパイル時に The type or namespace name `MyNamespace' could not be found. Are you missing a using directive or an assembly reference? と表示される。
発生している問題・エラーメッセージ
6行目 using MyNamespace.Blah;
The type or namespace name `MyNamespace' could not be found. Are you missing a using directive or an assembly reference?
該当のソースコード
C#
1using System; 2using UnityEngine; 3using UnityStandardAssets.CrossPlatformInput; 4using UnityStandardAssets.Utility; 5using Random = UnityEngine.Random; 6using MyNamespace.Blah; 7public class FirstPersonController : MonoBehaviour 8 { 9 [SerializeField] private bool m_IsWalking; 10 [SerializeField] private float m_WalkSpeed; 11 [SerializeField] private float m_RunSpeed; 12 [SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten; 13 [SerializeField] private float m_JumpSpeed; 14 [SerializeField] private float m_StickToGroundForce; 15 [SerializeField] private float m_GravityMultiplier; 16 [SerializeField] private UnityStandardAssets.Characters.FirstPerson.MouseLook m_MouseLook; 17 [SerializeField] private bool m_UseFovKick; 18 [SerializeField] private FOVKick m_FovKick = new FOVKick(); 19 [SerializeField] private bool m_UseHeadBob; 20 [SerializeField] private CurveControlledBob m_HeadBob = new CurveControlledBob(); 21 [SerializeField] private LerpControlledBob m_JumpBob = new LerpControlledBob(); 22 [SerializeField] private float m_StepInterval; 23 [SerializeField] private AudioClip[] m_FootstepSounds; // an array of footstep sounds that will be randomly selected from. 24 [SerializeField] private AudioClip m_JumpSound; // the sound played when character leaves the ground. 25 [SerializeField] private AudioClip m_LandSound; // the sound played when character touches back on ground. 26 27 private Camera m_Camera; 28 private bool m_Jump; 29 private float m_YRotation; 30 private Vector2 m_Input; 31 private Vector3 m_MoveDir = Vector3.zero; 32 private CharacterController m_CharacterController; 33 private CollisionFlags m_CollisionFlags; 34 private bool m_PreviouslyGrounded; 35 private Vector3 m_OriginalCameraPosition; 36 private float m_StepCycle; 37 private float m_NextStep; 38 private bool m_Jumping; 39 private AudioSource m_AudioSource; 40 41 42 // Use this for initialization 43 private void Start() 44 { 45 m_CharacterController = GetComponent<CharacterController>(); 46 m_Camera = Camera.main; 47 m_OriginalCameraPosition = m_Camera.transform.localPosition; 48 m_FovKick.Setup(m_Camera); 49 m_HeadBob.Setup(m_Camera, m_StepInterval); 50 m_StepCycle = 0f; 51 m_NextStep = m_StepCycle/2f; 52 m_Jumping = false; 53 m_AudioSource = GetComponent<AudioSource>(); 54 m_MouseLook.Init(transform , m_Camera.transform); 55 56 } 57 58 59 // Update is called once per frame 60 private void Update() 61 { 62 RotateView(); 63 // the jump state needs to read here to make sure it is not missed 64 if (!m_Jump) 65 { 66 m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); 67 } 68 69 if (!m_PreviouslyGrounded && m_CharacterController.isGrounded) 70 { 71 StartCoroutine(m_JumpBob.DoBobCycle()); 72 PlayLandingSound(); 73 m_MoveDir.y = 0f; 74 m_Jumping = false; 75 } 76 if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded) 77 { 78 m_MoveDir.y = 0f; 79 } 80 81 m_PreviouslyGrounded = m_CharacterController.isGrounded; 82 } 83 ... 84 85 86
###該当のソースコード
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Kinect = Windows.Kinect;
//using MyNamespace.Blash;
namespace MyNamespace.Blash{
public class BodySourceView : MonoBehaviour
{
public Material BoneMaterial;
public GameObject BodySourceManager;
private Dictionary<ulong, GameObject> _Bodies = new Dictionary<ulong, GameObject>(); private BodySourceManager _BodyManager; Kinect.CoordinateMapper _CoordinateMapper; public Camera Camera; Camera _Camera; int SensorWidth = 1920; int SensorHeight = 1080; float matakan_before=0; float matakan_heikatu=0; int count = 0; float[] matakan = new float[7]; int[] omomi = { -2, 3, 6, 7, 6, 3, -2 }; float sokutei_omomi_wa = 0; public float v = 0;
...
試したこと
https://stackoverrun.com/ja/q/9273631
を参考に直しましたがエラーが消えません。
BodySourceViewスクリプトの変数vはpublicになっています。
補足情報(FW/ツールのバージョンなど)
Unity 5.4.1f1
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/10 10:00