本文整理汇总了C#中Vector3.ToUnity方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.ToUnity方法的具体用法?C# Vector3.ToUnity怎么用?C# Vector3.ToUnity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.ToUnity方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Raycast
public bool Raycast(Vector3 origin, Vector3 direction, out Uniject.RaycastHit hitinfo, float distance, int layerMask)
{
UnityEngine.RaycastHit unityHit = new UnityEngine.RaycastHit();
bool result = UnityEngine.Physics.Raycast(origin.ToUnity(), direction.ToUnity(), out unityHit, distance, layerMask);
if (result) {
IGameObject testable = null;
var bridge = unityHit.collider.gameObject.GetComponent<UnityBridgeComponent>();
if (null != bridge) {
testable = bridge.GameObject;
}
hitinfo = new RaycastHit (unityHit.point.ToUniject(),
unityHit.normal.ToUniject(),
unityHit.barycentricCoordinate.ToUniject(),
unityHit.distance,
unityHit.triangleIndex,
unityHit.textureCoord.ToUniject(),
unityHit.textureCoord2.ToUniject(),
unityHit.lightmapCoord.ToUniject(),
testable,
unityHit.collider.ToUniject());
} else {
hitinfo = new RaycastHit();
}
return result;
}
示例2: setDestination
public void setDestination(Vector3 target)
{
agent.SetDestination(target.ToUnity());
}
示例3: AddTorque
public void AddTorque(Vector3 torque, ForceMode mode)
{
this.body.AddTorque(torque.ToUnity(), (UnityEngine.ForceMode)mode);
}
示例4: AddForce
public void AddForce(Vector3 force)
{
this.body.AddForce(force.ToUnity());
}
示例5: LookRotation
public Quaternion LookRotation(Vector3 direction, Vector3 up)
{
return UnityEngine.Quaternion.LookRotation(direction.ToUnity(), up.ToUnity()).ToUniject();
}
示例6: Translate
public void Translate(Vector3 byVector)
{
Transform.Translate(byVector.ToUnity());
}
示例7: TransformDirection
public Vector3 TransformDirection(Vector3 dir)
{
return Transform.TransformDirection(dir.ToUnity()).ToUniject();
}
示例8: Rotate
public void Rotate(Vector3 eulerAngle, Space space = Space.Self)
{
Transform.Rotate(eulerAngle.ToUnity(), (UnityEngine.Space)space);
}
示例9: LookAt
public void LookAt(Vector3 point)
{
Transform.LookAt(point.ToUnity());
}