示例#1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#2
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                if (hit.collider != null)
                {
                    TVScreen tvScreen = hit.collider.gameObject.GetComponent <TVScreen>();
                    if (tvScreen != null)
                    {
                        UIMain.Instance.OnTvClicked(tvScreen.id);
                    }
                }
            }
        }
    }