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


C# GameObject.SetForward方法代码示例

本文整理汇总了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);
 }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:5,代码来源:MoveThings.cs

示例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);
 }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:5,代码来源:MoveThings.cs

示例3: TurnRight

 internal static void TurnRight(GameObject sim)
 {
     Vector3 newForward = Quaternion.MakeFromEulerAngles(0f, ANGLE_90, 0f).ToMatrix().TransformVector(sim.ForwardVector);
     sim.SetForward(newForward);
 }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:5,代码来源:MoveThings.cs

示例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);
        }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:9,代码来源:MoveThings.cs

示例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);                
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:DisplayHelper.cs

示例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);
        }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:41,代码来源:PoseManager.cs


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