private IEnumerator RefreshController(int id)
    {
        yield return(null);

        yield return(null);

        if (Controller.UPvr_GetControllerState(id) == ControllerState.Connected)
        {
            if (systemOrUnity == 0)
            {
                LoadControllerFromPrefab();
                if (!loadModelSuccess)
                {
                    LoadControllerFromSystem(id);
                }
            }
            else
            {
                var isControllerExist = false;
                foreach (Transform t in transform)
                {
                    if (t.name == modelName)
                    {
                        isControllerExist = true;
                    }
                }
                if (!isControllerExist)
                {
                    LoadControllerFromSystem(id);
                    if (!loadModelSuccess)
                    {
                        LoadControllerFromPrefab();
                    }
                }
                else
                {
                    var currentController = transform.Find(modelName);
                    currentController.gameObject.SetActive(true);
                }
            }
            Pvr_ToolTips.RefreshTips();
            PLOG.I("PvrLog Controller Refresh Success");
        }
    }
Beispiel #2
0
 private void Awake()
 {
     tooltips = transform.GetComponent <Pvr_ToolTips>();
 }