本文整理汇总了C#中GameObject.SetForward方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.SetForward方法的具体用法?C# GameObject.SetForward怎么用?C# GameObject.SetForward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.SetForward方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TurnAround
internal static void TurnAround(GameObject sim)
{
Vector3 newForward = new Vector3(-sim.ForwardVector.x, sim.ForwardVector.y, -sim.ForwardVector.z);
sim.SetForward(newForward);
}
示例2: Tilt
internal static void Tilt(GameObject sim, float x, float y, float z)
{
Vector3 newForward = new Vector3(x, y, z).Normalize();
sim.SetForward(newForward);
}
示例3: TurnRight
internal static void TurnRight(GameObject sim)
{
Vector3 newForward = Quaternion.MakeFromEulerAngles(0f, ANGLE_90, 0f).ToMatrix().TransformVector(sim.ForwardVector);
sim.SetForward(newForward);
}
示例4: TurnLeft
internal static void TurnLeft(GameObject sim)
{
Vector3 newForward = Quaternion.MakeFromEulerAngles(0f, ANGLE_315, 0f).ToMatrix().TransformVector(sim.ForwardVector);
sim.SetForward(newForward);
//Quaternion q = Quaternion.MakeFromEulerAngles(0, ANGLE_45, 0);
//Vector3 newForward = (q * sim.ForwardVector).Vector;
//sim.SetForward(newForward);
}
示例5: ParentToSlot
public static void ParentToSlot(GameObject obj, Slot slot, GameObject parent)
{
if (obj != null && parent != null)
{
obj.SetPosition(parent.GetPositionOfSlot(slot));
obj.SetForward(parent.GetForwardOfSlot(slot));
obj.ParentToSlot(parent, slot);
}
}
示例6: RemoveMoveInteractions
public static void RemoveMoveInteractions(GameObject gameObject, bool resetLocation)
{
if (MovedObjects.ContainsKey(gameObject))
{
if (resetLocation)
{
LocationVectors vectors;
if (MovedObjects.TryGetValue(gameObject, out vectors))
{
gameObject.SetForward(vectors.ForwardVector);
gameObject.SetPosition(vectors.Position);
}
}
MovedObjects.Remove(gameObject);
}
gameObject.RemoveInteractionByType(StopMovingMe.Singleton);
gameObject.RemoveInteractionByType(TurnLeft.Singleton);
gameObject.RemoveInteractionByType(TurnAtAngle.Singleton);
gameObject.RemoveInteractionByType(TurnRight.Singleton);
gameObject.RemoveInteractionByType(TurnAround.Singleton);
gameObject.RemoveInteractionByType(TiltFaceUp.Singleton);
gameObject.RemoveInteractionByType(TiltBack.Singleton);
gameObject.RemoveInteractionByType(TiltForward.Singleton);
gameObject.RemoveInteractionByType(TiltFaceDown.Singleton);
gameObject.RemoveInteractionByType(TiltUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveUp.Singleton);
gameObject.RemoveInteractionByType(MoveUpUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveDown.Singleton);
gameObject.RemoveInteractionByType(MoveDownUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveBack.Singleton);
gameObject.RemoveInteractionByType(MoveBackUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveForward.Singleton);
gameObject.RemoveInteractionByType(MoveForwardUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveRight.Singleton);
gameObject.RemoveInteractionByType(MoveRightUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveLeft.Singleton);
gameObject.RemoveInteractionByType(MoveLeftUserDefined.Singleton);
}