本文整理汇总了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)
{
示例2: IsPointValid
public bool IsPointValid(Vector3 point)
{
return isPointValid(_crowd.Handle, point.ToFloat());
}
示例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;
}
示例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);
}