Пример #1
0
    // Update is called once per frame
    void Update()
    {
        float rotation_z = (APIdou.accel [0] / 16384.0f) * 90.0f;
        float rotation_x = (APIdou.accel [2] / 16384.0f) * 90.0f;

        transform.rotation = Quaternion.Euler(new Vector3(rotation_x, 0, -rotation_z));

        if (APIdou.isTouched(APIdou.ANTENNA))
        {
            Debug.Log("Antenna Touched");
        }
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     apidou = GameObject.Find("Main Camera").GetComponent <APIdou> ();
 }