Exemple #1
0
    void OnTap(int finger, Vector2 pos)
    {
        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out hit))
        {
            GameObject go = hit.transform.gameObject;
            MusicCube  mc = go.GetComponent <MusicCube> ();
            if (mc != null)
            {
                mc.Play();
                mc.finger = finger;
                cubes.Add(mc);
            }
        }
    }