简体   繁体   中英

The type or namespace name `Kinect' does not exist in the namespace `Microsoft'

I am using Unity to develop a game and I want to use Kinect so I add a reference to Microsoft.Kinect.ddl and I have the following code (nothing impressive):

using UnityEngine;
using System.Collections;
using Microsoft.Kinect;

public class Main : MonoBehaviour {

    // Use this for initialization
    void Start () {
        print(KinectSensor.KinectSensors.Count);
    }

    // Update is called once per frame
    void Update () {

    }
}

Visual Studio does not mark any error but when I am trying to run it using Unity I am getting a compilation error The type or namespace name Kinect does not exist in the namespace Microsoft . Any idea how can I fix that?

See this page for using the SDK with unity. It does have some obvious errors though (as pointed out in the documentation.)

I am using k2examples asset from the asset store, and I ran into the same problem... since you are not using the same asset, this might not solve the problem, but you can give it a try:

import the standard assets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM