示例#1
0
    public void Synchronize(Robot robot, GameObject rootObject, string assetRoot)
    {
        GameObject robotGameObject = rootObject;

        robotGameObject.AddComponentIfNotExists <UrdfRobot>();

        UrdfAssetPathHandler.SetPackageRoot(assetRoot);
        UrdfMaterial.InitializeRobotMaterials(robot);
        UrdfPlugins.Synchronize(robotGameObject.transform, robot.plugins);

        UrdfLinkExtensions.Synchronize(robotGameObject.transform, robot.root);
    }
示例#2
0
        /// <summary>
        /// Synchronizes the <paramref name="rootObject"/> with the <paramref name="robot"/>
        /// </summary>
        /// <param name="robot"></param>
        /// <param name="rootObject"></param>
        public void Synchronize(Robot robot, GameObject rootObject)
        {
            LocateAssetHandler.SetRobotName(robot.name);

            GameObject robotGameObject = rootObject;

            robotGameObject.AddComponentIfNotExists <UrdfRobot>();

            UrdfPlugins.Synchronize(robotGameObject.transform, robot.plugins);

            UrdfLinkExtensions.Synchronize(robotGameObject.transform, robot.root);

            //These tags are needed for the Camera/Sensors to interact with the gameobject
            foreach (var child in rootObject.GetComponentsInChildren <Transform>())
            {
                child.gameObject.tag = "Robot";
            }
        }