예제 #1
0
    // Use this for initialization
    void Start()
    {
        // Find links to objects
        if (KinectManager == null)
        {
            KinectManager = GameObject.Find(KinectManagerName).GetComponent <MyKinectManager>();
        }

        if (KinectManager == null)
        {
            Debug.LogError("No KinectManager Found On The Scene");
        }

        LevelTitle      = GetComponent <TextMesh>();
        LevelTitle.text = "Catch all the balls !!!";

        for (int i = 0; i < extrapolationCount; i++)
        {
            xExtrapolationList.Add(0.0f);
            yExtrapolationList.Add(0.0f);
        }

        // move KinectManager (with TextMesh in it)
        iTween.MoveTo(KinectManager.gameObject, iTween.Hash("x", KinectManagerPosition.x, "y", KinectManagerPosition.y, "easeType", "easeInOutQuad", "time", 1.0f));
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     if (KinectManager == null)
     {
         KinectManager = GameObject.Find(KinectManagerName).GetComponent <MyKinectManager>();
     }
 }
예제 #3
0
 // Make sure to kill the Kinect on quitting.
 void OnApplicationQuit()
 {
     if (KinectInitialized)
     {
         // Shutdown OpenNI
         KinectWrapper.NuiShutdown();
         instance = null;
     }
 }
예제 #4
0
 /// <summary>
 /// MonoBehaviour function
 /// </summary>
 public void Awake()
 {
     if (instance)
     {
         Destroy(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
 }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        sen01.transform.localScale = new Vector3(0.0F, 0.00f, 0.00f);
        mkm = cameraA.GetComponent <MyKinectManager> ();
//		go=ListTexture[1];
//		light=ListTexture[3];
//		rotate =ListTexture[5];
//		sen =ListTexture[7];
//		ButtonTexture[0].texture = ListTexture[1];
//		ButtonTexture[1].texture = ListTexture[3];
//		ButtonTexture[2].texture = ListTexture[4];
//		ButtonTexture[3].texture = ListTexture[6];
        //ButtonTexture[4].texture = ListTexture[6];
        ButtonPostion    = new Vector3[6];
        ButtonPostion[0] = new Vector3(cameraA.pixelWidth * 0.1f, cameraA.pixelHeight * (0.70f - buttonheight), 1f);
        ButtonPostion[1] = new Vector3(cameraA.pixelWidth * 0.2f, cameraA.pixelHeight * (0.83f - buttonheight), 1f);
        ButtonPostion[5] = new Vector3(cameraA.pixelWidth * 0.38f, cameraA.pixelHeight * (0.90f - buttonheight), 1f);
        ButtonPostion[3] = new Vector3(cameraA.pixelWidth * 0.62f, cameraA.pixelHeight * (0.90f - buttonheight), 1f);
        ButtonPostion[4] = new Vector3(cameraA.pixelWidth * 0.8f, cameraA.pixelHeight * (0.83f - buttonheight), 1f);
        ButtonPostion[2] = new Vector3(cameraA.pixelWidth * 0.9f, cameraA.pixelHeight * (0.70f - buttonheight), 1f);

        chelun01.GetComponent <Animation>().Stop();
        chelun02.GetComponent <Animation>().Stop();
        lu.GetComponent <Animation>().Stop("lu");
        len01.active = false;
        len02.active = false;
        c            = 2;
        bani[0]      = (buttonani)(ButtonTexture[0].GetComponent <buttonani>());
        bani[1]      = (buttonani)(ButtonTexture[1].GetComponent <buttonani>());
        bani[2]      = (buttonani)(ButtonTexture[2].GetComponent <buttonani>());
        bani[3]      = (buttonani)(ButtonTexture[3].GetComponent <buttonani>());
        bani[4]      = (buttonani)(ButtonTexture[4].GetComponent <buttonani>());
        bani[5]      = (buttonani)(ButtonTexture[5].GetComponent <buttonani>());
        bani[0].init();
        bani[1].init();
        bani[2].init();
        bani[3].init();
        bani[4].init();
        bani[5].init();
        ButtonTexture[3].GetComponent <GUITexture>().texture = sens01texture;
        Tempchangecolor = (changecolor)changecolor.GetComponent <changecolor>();
        ButtonTexture[5].transform.localPosition = new Vector3(0.1f, (0.70f - buttonheight), 1f);
        ButtonTexture[1].transform.localPosition = new Vector3(0.1f, (0.70f - buttonheight), 1f);;
        ButtonTexture[0].transform.localPosition = new Vector3(0.28f, (0.83f - buttonheight), 1f);;
        ButtonTexture[3].transform.localPosition = new Vector3(0.5f, (0.90f - buttonheight), 1f);;
        ButtonTexture[4].transform.localPosition = new Vector3(0.72f, (0.83f - buttonheight), 1f);;
        ButtonTexture[2].transform.localPosition = new Vector3(0.9f, (0.70f - buttonheight), 1f);;
        carpostion = (GetPostion)Car.GetComponent <GetPostion>();
        ButtonTexture[5].GetComponent <GUITexture>().texture = sens01texture;
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        // Find links to objects
        if (KinectManager == null)
        {
            KinectManager = GameObject.Find(KinectManagerName).GetComponent <MyKinectManager>();
        }

        if (KinectManager == null)
        {
            Debug.LogError("No KinectManager Found On The Scene");
        }

        LevelTitle      = GetComponent <TextMesh>();
        LevelTitle.text = "Choose Hand To Play";

        // Coroutine with animations.
        // At the end it changes state
        StartCoroutine(StartingAnimation());
    }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     //store bones in a list for easier access
     ///Kinect.NuiSkeletonPositionIndex.Count
     _bones = new GameObject[(int)20] {
         Hip_Center, Spine, Shoulder_Center, Head,
         Shoulder_Left, Elbow_Left, Wrist_Left, Hand_Left,
         Shoulder_Right, Elbow_Right, Wrist_Right, Hand_Right,
         Hip_Left, Knee_Left, Ankle_Left, Foot_Left,
         Hip_Right, Knee_Right, Ankle_Right, Foot_Right
     };
     //_bonePos = new Vector4[(int)BoneIndex.Num_Bones];
     GP        = (GetPostion)(Car.GetComponent <GetPostion>()); //Car.GetComponent("GetPostion")
     WS        = (WtoStest)(Point.GetComponent <WtoStest>());   //Point.GetComponent("WtoStest")
     TimeCount = 0;
     GP.a      = 1;
     WS.A      = 1;
     tempdrag  = (dragmouse)GetDebugPlane.GetComponent <dragmouse>();      //GameObject.GetComponent<T>()GetComponent("dragmouse")
     MkM       = (MyKinectManager)Maincamera.GetComponent <MyKinectManager> ();
     moverange = new Vector2(1, 3);
 }