Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //rigidbody.centerOfMass = new Vector3(0, 0, 1);

        BlueComm bc = GetComponent <BlueComm>();

        //位置初期化
        //BatInit();
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        //マウスの位置によって回転させる
        Vector3 pos = Input.mousePosition;

        transform.rotation = Quaternion.Euler(pos.x / 2, 0, 0);

        //BlueNinjaからデータ取得
        BlueComm bc = GetComponent <BlueComm>();

        /*/加速度による移動
         * var dir = Vector3.zero;
         * dir = bc.Acceleration;
         * if(dir != null)
         * {
         *  dir.Normalize();
         *  transform.Translate(dir);
         * }
         *
         * //ジャイロによる回転
         * Quaternion gyro = Quaternion.Euler(bc.Gyro);
         * if(gyro != null)
         *  transform.rotation = gyro;*/
    }