コード例 #1
0
    void AddClusterScripts(GameObject iObject, bool iChildren)
    {
        //MiddleVRTools.Log("AddCluster to " + iObject);
        //print("AddCluster to " + iObject);
        {
            if (iObject.GetComponent <VRShareTransform>() == null)
            {
                VRShareTransform script = iObject.AddComponent <VRShareTransform>() as VRShareTransform;
                script.Start();
            }

            if (iObject.GetComponent <VRApplySharedTransform>() == null)
            {
                VRApplySharedTransform script = iObject.AddComponent <VRApplySharedTransform>() as VRApplySharedTransform;
                script.Start();
            }
        }

        if (iChildren == true)
        {
            foreach (Transform child in iObject.transform)
            {
                GameObject childObject = child.gameObject;

                //print("Child : " + childObject);
                AddClusterScripts(childObject, true);
            }
        }
    }
コード例 #2
0
    void AddClusterScripts(GameObject iObject)
    {
        MiddleVRTools.Log(2, "[ ] Adding cluster sharing scripts to " + iObject.name);
        if (iObject.GetComponent <VRShareTransform>() == null)
        {
            VRShareTransform script = iObject.AddComponent <VRShareTransform>() as VRShareTransform;
            script.Start();
        }

        if (iObject.GetComponent <VRApplySharedTransform>() == null)
        {
            VRApplySharedTransform script = iObject.AddComponent <VRApplySharedTransform>() as VRApplySharedTransform;
            script.Start();
        }
    }