当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.ToFloat方法代码示例

本文整理汇总了C#中Vector3.ToFloat方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.ToFloat方法的具体用法?C# Vector3.ToFloat怎么用?C# Vector3.ToFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vector3的用法示例。


在下文中一共展示了Vector3.ToFloat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConvertFromUnity


//.........这里部分代码省略.........
                    // Navigation link
                    metaData.meshLink = null;
                    var navigationLink = gameObject.GetComponent<OffMeshLink>();
                    if (navigationLink != null)
                    {
                        componentTags += " [MESHLINK]";
                        Dictionary<string, object> linkInfo = new Dictionary<string, object>();
                        linkInfo.Add("name", navigationLink.name);
                        linkInfo.Add("activated", navigationLink.activated);
                        linkInfo.Add("area", navigationLink.area);
                        linkInfo.Add("autoUpdatePositions", navigationLink.autoUpdatePositions);
                        linkInfo.Add("biDirectional", navigationLink.biDirectional);
                        linkInfo.Add("costOverride", navigationLink.costOverride);
                        linkInfo.Add("occupied", navigationLink.occupied);
                        linkInfo.Add("start", GetTransformPropertyValue(navigationLink.startTransform));
                        linkInfo.Add("end", GetTransformPropertyValue(navigationLink.endTransform));
                        metaData.meshLink = linkInfo;
                    }

                    // Navigation obstacle
                    metaData.meshObstacle = null;
                    var navigationObstacle = gameObject.GetComponent<NavMeshObstacle>();
                    if (navigationObstacle != null)
                    {
                        componentTags += " [MESHOBSTACLE]";
                        Dictionary<string, object> obstacleInfo = new Dictionary<string, object>();
                        obstacleInfo.Add("name", navigationObstacle.name);
                        obstacleInfo.Add("carving", navigationObstacle.carving);
                        obstacleInfo.Add("carveOnlyStationary", navigationObstacle.carveOnlyStationary);
                        obstacleInfo.Add("carvingMoveThreshold", navigationObstacle.carvingMoveThreshold);
                        obstacleInfo.Add("carvingTimeToStationary", navigationObstacle.carvingTimeToStationary);
                        obstacleInfo.Add("shape", navigationObstacle.shape.ToString());
                        obstacleInfo.Add("radius", navigationObstacle.radius);
                        obstacleInfo.Add("center", navigationObstacle.center.ToFloat());
                        obstacleInfo.Add("size", navigationObstacle.size.ToFloat());
                        metaData.meshObstacle = obstacleInfo;
                    }

                    // Tags component
                    var tagsComponent = gameObject.GetComponent<BabylonTagsComponent>();
                    if (tagsComponent != null)
                    {
                        if (!String.IsNullOrEmpty(tagsComponent.babylonTags))
                        {
                            componentTags += (" " + tagsComponent.babylonTags);
                        }
                    }

                    // Script components
                    var gameComponents = gameObject.GetComponents<BabylonScriptComponent>();
                    if (gameComponents != null)
                    {
                        var components = new List<object>();
                        foreach (var gameComponent in gameComponents)
                        {
                            Type componentType = gameComponent.GetType();
                            string componentName = componentType.FullName;
                            var component = new UnityScriptComponent();
                            MonoScript componentScript = MonoScript.FromMonoBehaviour(gameComponent);
                            component.order = MonoImporter.GetExecutionOrder(componentScript);
                            component.name = componentName;
                            component.klass = gameComponent.babylonClass;
                            component.update = (gameComponent.updateOption == BabylonTickOptions.EnableTick);
                            component.controller = (gameComponent is BabylonSceneController);
                            if (component.controller == true)
                            {
开发者ID:BabylonJS,项目名称:Babylon.js,代码行数:67,代码来源:SceneBuilder.cs

示例2: IsPointValid

 public bool IsPointValid(Vector3 point)
 {
     return isPointValid(_crowd.Handle, point.ToFloat());
 }
开发者ID:srferran,项目名称:ES2015A,代码行数:4,代码来源:DetourCrowd.cs

示例3: RandomValidPointInCircle

        public bool RandomValidPointInCircle(Vector3 cercleCenter, float maxRadius, ref Vector3 dest)
        {
            Assert.IsTrue(_crowd.Handle.ToInt64() != 0);

            if (randomPointInCircle(_crowd.Handle, cercleCenter.ToFloat(), maxRadius, randomSample))
            {
                dest = randomSample.ToVector3();
                return true;
            }

            return false;
        }
开发者ID:srferran,项目名称:ES2015A,代码行数:12,代码来源:DetourCrowd.cs

示例4: MoveTarget

        public void MoveTarget(DetourAgent agent, Vector3 target)
        {
            Assert.IsTrue(_crowd.Handle.ToInt64() != 0);
            Assert.IsTrue(_tileCache.NavQueryHandle.Handle.ToInt64() != 0);

            setMoveTarget(_tileCache.NavQueryHandle.Handle, _crowd.Handle, agent.ID, target.ToFloat(), false, agent.FilterIndex);
        }
开发者ID:srferran,项目名称:ES2015A,代码行数:7,代码来源:DetourCrowd.cs


注:本文中的Vector3.ToFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。