Example #1
0
    /// <summary>
    /// 生成KinectController Prefabs
    /// </summary>
    /// <param name="vector3"></param>
    public void SetKinectController(Vector3 vector3)
    {
        //生成KinectManager
        //并将Kinect 赋值
        GameObject Controller = null;

        _kinectManager           = Controller.GetComponentInChildren <KinectManager>();
        _avatarControllerClassic = Controller.GetComponentInChildren <AvatarControllerClassic>();
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     GM           = (GameManager)GameObject.Find("GameManager").GetComponent <GameManager>();
     AvatarScript = (AvatarControllerClassic)this.GetComponentInParent(typeof(AvatarControllerClassic));
     //BodyRoot = AvatarScript.GetHipPos(); // used to get real height of player hips for jumping
     if (AvatarScript)
     {
         AvatarScript.RegisterAstroJump(this);
     }
     BodyRootY       = 0;
     OldBodyRootPosY = 0;
     //previousCoreY = Core.transform.localPosition.y;
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     //this.transform.position = new Vector3 (this.transform.position.x, 0, this.transform.position.z);
     AvatarScript = (AvatarControllerClassic)Avatar.GetComponent(typeof(AvatarControllerClassic));
     RgdBody      = (Rigidbody)GetComponent(typeof(Rigidbody));
     BodyRoot     = AvatarScript.GetHipPos();     // used to get real height of player hips for jumping
     //	if(AvatarScript) AvatarScript.RegisterJumpAmplifier (this);
     BodyRootY          = BodyRoot.y;
     OldBodyRootPosY    = BodyRootY;
     RgdBody.useGravity = false;
     GroundHeight       = this.transform.position.y;
     JumpHeight         = GroundHeight;
 }