Example #1
0
    public void Initialize()
    {
        InitializeRaycastCamera();
        GameObject[] gameObjects = GameObject.FindGameObjectsWithTag("UID Object");

        for (int i = 0; i < gameObjects.Length; i++)
        {
            VRDOC_Object vrdocObject = gameObjects[i].GetComponent <VRDOC_Object>();
            if (vrdocObject == null)
            {
                vrdocObject = gameObjects[i].AddComponent <VRDOC_Object>();
            }
            objects.Add(vrdocObject);
            objectsDictionary.Add(gameObjects[i].transform, vrdocObject);
        }

        awaitingResponse = true;
        lock (generatePointsLock) {
            threadIsDone = false;
        }
        ThreadPool.QueueUserWorkItem((object obj) => {
            try {
                GenerateRaycastPoints(obj);
            } catch (System.Exception e) {
                UnityEngine.Debug.Log(e);
            }
        }, null);
    }
Example #2
0
    public void VRDOC_EnableRenderer(Transform target)
    {
        // vo = target.GetComponent<VRDOC_Object>();
        vo = objectsDictionary.ContainsKey(target) ? objectsDictionary[target] : null;

        if (vo != null)
        {
            vo.VRDOC_EnableRenderer();
        }
        else if (target.parent != null)
        {
            VRDOC_EnableRenderer(target.parent);
        }
    }