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


C# Space类代码示例

本文整理汇总了C#中Space的典型用法代码示例。如果您正苦于以下问题:C# Space类的具体用法?C# Space怎么用?C# Space使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Main

        static void Main(string[] args)
        {
            using (var space = new Space())
            {

            }
        }
开发者ID:veggielane,项目名称:SharpEngine,代码行数:7,代码来源:Program.cs

示例2: OnRemovalFromSpace

 /// <summary>
 /// Called before an object is removed from its space.
 /// </summary>
 public override void OnRemovalFromSpace(Space oldSpace)
 {
     for (int i = 0; i < solverUpdateables.Count; i++)
     {
         solverUpdateables[i].OnRemovalFromSpace(oldSpace);
     }
 }
开发者ID:Raverenx,项目名称:GameEngine,代码行数:10,代码来源:SolverGroup.cs

示例3: OnReset

 public override void OnReset()
 {
     if (translation != null) {
         translation.Value = Vector3.zero;
     }
     relativeTo = Space.Self;
 }
开发者ID:rjchart,项目名称:Project_YSS_2D,代码行数:7,代码来源:Translate.cs

示例4: Reset

 public override void Reset()
 {
     gameObject = null;
     moveVector = new FsmVector3 {UseVariable = true};
     space = Space.World;
     perSecond = true;
 }
开发者ID:Streek,项目名称:FSM-Action-Collection-for-UN-PM,代码行数:7,代码来源:ControllerMove.cs

示例5: Awake

    // Use this for initialization
    void Awake()
    {
        Debug.Assert(SaveGameEventSubscription == null && AutoSaveGameEventSubscription == null);
        SaveGameEventSubscription= MessageHub.Subscribe<SaveGameEvent>(SaveGame);
        AutoSaveGameEventSubscription = MessageHub.Subscribe<AutoSaveGameEvent>(AutoSaveGame);

        mapData = new CollectedMapData();

        space = GameObject.Find("Space").GetComponent<Space>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find Space. The big bang doesn't have enough space to happen. The 'Space' game object also needs to be added to the level and have the space script attached.");
        }

        airTrafficControl = GameObject.Find("AirTrafficControl").GetComponent<AirTrafficControl>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find AirTrafficControl. There can't be any troops flying around without an global AirTrafficControl GameObject that has an AirTrafficControl Script attached.");
        }

        gameState = GameObject.Find("2D_MainCam").GetComponent<GameState>();
        if (gameState == null)
        {
            throw new MissingComponentException("Unable to find GameState. The 'GameState' script needs to be attached to the same Gameobject as the BigBang.");
        }
        playerManager = GameObject.Find("PlayerManagement").GetComponent<PlayerManager>();
        if (playerManager == null)
        {
            throw new MissingComponentException("Unable to find playerManager.");
        }
    }
开发者ID:simonides,项目名称:space_concept,代码行数:32,代码来源:GameSaver.cs

示例6: SetZ

 public static void SetZ(this Transform transform, float z, Space space = Space.Self)
 {
     if (space == Space.Self)
         transform.localPosition = transform.localPosition.ScaleBy(1, 1, 0) + z*Vector3.forward;
     else
         transform.position = transform.position.ScaleBy(1, 1, 0) + z*Vector3.forward;
 }
开发者ID:fatiguedartist,项目名称:Sisyphus,代码行数:7,代码来源:RDVectorExtensions.cs

示例7: Done

        public void Done()
        {
            if (SpaceName != null)
                SpaceName = SpaceName.Trim();
            if (string.IsNullOrWhiteSpace(SpaceName))
            {
                MessageBox.Show("Profile name is empty", "Locality", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }
            if (SpaceName.Length > 30)
            {
                MessageBox.Show("Profile name is too long", "Locality", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            foreach (var spc in App.Instance.Config.Spaces)
                if (spc.Name.Equals(SpaceName, StringComparison.InvariantCultureIgnoreCase))
                {
                    MessageBox.Show("This profile already exists", "Locality", MessageBoxButton.OK, MessageBoxImage.Warning);
                    return;
                }

            var s = new Space { Name = SpaceName, Id = Guid.NewGuid().ToString() };
            App.Instance.Config.Spaces.Add(s);
            (Parent as RootViewModel).Back();
        }
开发者ID:Eugeny,项目名称:Locality,代码行数:26,代码来源:AddSpaceViewModel.cs

示例8: SetY

 public static void SetY(this Transform transform, float y, Space space = Space.Self)
 {
     if (space == Space.Self)
         transform.localPosition = transform.localPosition.ScaleBy(1, 0, 1) + y*Vector3.up;
     else
         transform.position = transform.position.ScaleBy(1, 0, 1) + y*Vector3.up;
 }
开发者ID:fatiguedartist,项目名称:Sisyphus,代码行数:7,代码来源:RDVectorExtensions.cs

示例9: Reset

 public override void Reset()
 {
     this.gameObject = null;
     this.space = Space.World;
     this.storePosition = null;
     this.everyFrame = false;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:7,代码来源:GetVertexPosition.cs

示例10: AttachGO

        public void AttachGO(Transform dest, Transform source, Vector3 position, Quaternion rotation, Vector3 scale,
            Space space = Space.Self)
        {
            if (source == null)
                return;

            if (dest == null)
            {
                source.parent = null;
            }
            else
            {
                source.parent = dest.transform;
            }
            if (space == Space.Self)
            {
                source.transform.localPosition = position;
                source.transform.localRotation = rotation;
            }
            else
            {
                source.transform.position = position;
                source.transform.rotation = rotation;
            }
            source.transform.localScale = scale;
        }
开发者ID:TheManatthegate,项目名称:Goranee,代码行数:26,代码来源:GameObjectUtil.cs

示例11: Reset

		public override void Reset()
		{
			gameObject = null;
			space = Space.World;
			storePosition = null;
			everyFrame = false;
		}
开发者ID:DIGM680,项目名称:NarrativePlatformer,代码行数:7,代码来源:GetVertexPosition.cs

示例12: OnReset

 public override void OnReset()
 {
     if (eulerAngles != null) {
         eulerAngles.Value = Vector3.zero;
     }
     relativeTo = Space.Self;
 }
开发者ID:TrojanFighter,项目名称:U3D-DesignerBehaviorTest1,代码行数:7,代码来源:Rotate.cs

示例13: Update

    void Update()
    {
        if (!Application.isEditor)
        {
            Destroy(this);
            return;
        }

        if (FreezePosition)
        {
            // Save current position if enabled
            if ((FreezePosition != m_OldFreezePosition) || (space != m_OldSpace))
                m_Position = (space == Space.World) ? transform.position : transform.localPosition;
            // Freeze the position
            if (space == Space.World)
                transform.position = m_Position;
            else
                transform.localPosition = m_Position;
        }

        if (FreezeRotation)
        {
            // Save current rotation if enabled
            if ((FreezeRotation != m_OldFreezeRotation) || (space != m_OldSpace))
                m_Rotation = (space == Space.World) ? transform.rotation : transform.localRotation;
            // Freeze the rotation
            if (space == Space.World)
                transform.rotation = m_Rotation;
            else
                transform.localRotation = m_Rotation;
        }
        m_OldSpace = space;
        m_OldFreezePosition = FreezePosition;
        m_OldFreezeRotation = FreezeRotation;
    }
开发者ID:TerronUA,项目名称:LagstersTestBed,代码行数:35,代码来源:FreezeObject.cs

示例14: AddForce2D

    /// <summary>
    /// Function for applying a specific type of force to a Rigidbody2D (since the default functionality is incomplete)
    /// </summary>
    /// <param name="rb2d">Rigidbody2D to apply the force to</param>
    /// <param name="force">The amount of force to apply</param>
    /// <param name="mode">What type of force to apply</param>
    /// <param name="relativeTo">Should the force be applied in the rigidbody's local space, or world space?</param>
    public static void AddForce2D(this Rigidbody2D rb2d, Vector2 force, ForceMode mode = ForceMode.Force, Space relativeTo = Space.World)
    {
        ForceMode2D mode2D = ForceMode2D.Force;
        Vector2 forceApplied = force;
        switch (mode)
        {
            case ForceMode.Impulse:
                mode2D = ForceMode2D.Impulse;
                break;
            case ForceMode.Acceleration:
                forceApplied *= rb2d.mass;
                break;
            case ForceMode.VelocityChange:
                forceApplied = force * rb2d.mass / Time.fixedDeltaTime;
                break;
            case ForceMode.Force:
                //nothing special
                break;
        }

        if (relativeTo == Space.Self)
            rb2d.AddRelativeForce(forceApplied, mode2D);
        else if (relativeTo == Space.World)
            rb2d.AddForce(forceApplied, mode2D);
    }
开发者ID:Headgate2,项目名称:-mobile-games-pipeline,代码行数:32,代码来源:PhysicsExtensions.cs

示例15: Reset

 public override void Reset()
 {
     gameObject = null;
     speed = null;
     speedVector = null;
     space = Space.World;
 }
开发者ID:nothiphop,项目名称:PlayMakerCustomActions_U3,代码行数:7,代码来源:GetGameObjectSpeed.cs


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