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


C# Facing类代码示例

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


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

示例1: Update

		public void Update(PlayerButton input, Facing facing, Boolean paused)
		{
			m_inputbuffer.Add(input, facing);

			if (paused == false)
			{
				foreach (BufferCount count in m_commandcount.Values) count.Tick();
			}

			foreach (Command command in Commands)
			{
				if (command.IsValid == false) continue;

				if (CommandChecker.Check(command, m_inputbuffer) == true)
				{
					Int32 time = command.BufferTime;
					if (paused == true) ++time;

					m_commandcount[command.Name].Set(time);
				}
			}

			m_activecommands.Clear();
			foreach (var data in m_commandcount) if (data.Value.IsActive == true) m_activecommands.Add(data.Key);
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:25,代码来源:CommandManager.cs

示例2: FacingChanged

 protected bool FacingChanged(Facing f)
 {
     if (f != pFaceDirection)
         return true;
     else
         return false;
 }
开发者ID:Gornel,项目名称:Overworld,代码行数:7,代码来源:EnemyController.cs

示例3: CacheMovement

		public virtual void CacheMovement(Facing direction, MovementSpeed speed) {
			if (this.CacheMovements) {
				this.Queue.Enqueue(new Movement(direction, speed));
			} else {
				this.Entity.TryMove(direction, speed);
			}
		}
开发者ID:Hakua,项目名称:PokeSharp,代码行数:7,代码来源:LivingController.cs

示例4: SetupRobotFixture

 public static void SetupRobotFixture(this Mock<IRobot> mockRobot, int x, int y, Facing f, bool placed)
 {
     mockRobot.SetupProperty(r => r.X, x);
     mockRobot.SetupProperty(r => r.Y, y);
     mockRobot.SetupProperty(r => r.F, f);
     mockRobot.SetupProperty(r => r.Placed, placed);
 }
开发者ID:FinestV,项目名称:RobotTest,代码行数:7,代码来源:TestExtensions.cs

示例5: AddStructure

 public AddStructure(Position position, StructureType structureType, Facing frontFace)
     : this()
 {
     Position = position;
     StructureType = structureType;
     FrontFace = frontFace;
 }
开发者ID:MagistrAVSH,项目名称:voxelgame,代码行数:7,代码来源:AddStructure.cs

示例6: Sprite

 public Sprite(Vector2 position, float maxSpeed, Facing facing)
 {
     this.position = position;
     this.maxSpeed = maxSpeed;
     this.facing = facing;
     this.movement = Vector2.Zero;
 }
开发者ID:jbrownbridge,项目名称:Dischord,代码行数:7,代码来源:Sprite.cs

示例7: Add

		public void Add(PlayerButton input, Facing facing)
		{
			if (facing == Facing.Left)
			{
				if (((input & PlayerButton.Left) == PlayerButton.Left) != ((input & PlayerButton.Right) == PlayerButton.Right))
				{
					input ^= PlayerButton.Left;
					input ^= PlayerButton.Right;
				}
			}

			if (((input & PlayerButton.Up) == PlayerButton.Up) && ((input & PlayerButton.Down) == PlayerButton.Down))
			{
				input &= ~PlayerButton.Up;
				input &= ~PlayerButton.Down;
			}

			if (((input & PlayerButton.Left) == PlayerButton.Left) && ((input & PlayerButton.Right) == PlayerButton.Right))
			{
				input &= ~PlayerButton.Left;
				input &= ~PlayerButton.Right;
			}

			m_buffer.Add(input);
			m_size = m_buffer.Size;
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:26,代码来源:InputBuffer.cs

示例8: Update

    // Update is called once per frame
    void Update()
    {
        if (!Manager.DialogOpen)
        {
            if (Input.GetKey(KeyCode.D) && tr.position == position)
            {
                if(CanMove(Vector3.right))
                    position += Vector3.right * 0.32f;
                direction = Facing.Right;
            }
            else if (Input.GetKey(KeyCode.A) && tr.position == position)
            {
                if (CanMove(Vector3.left))
                    position += Vector3.left * 0.32f;
                direction = Facing.Left;
            }
            else if (Input.GetKey(KeyCode.W) && tr.position == position)
            {
                if (CanMove(Vector3.up))
                    position += Vector3.up * 0.32f;
                direction = Facing.Up;
            }
            else if (Input.GetKey(KeyCode.S) && tr.position == position)
            {
                if (CanMove(Vector3.down))
                    position += Vector3.down * 0.32f;
                direction = Facing.Down;
            }

            transform.position = Vector3.MoveTowards(transform.position, position, Time.deltaTime * moveSpeed);
        }
    }
开发者ID:SuperMeip,项目名称:RomanceTheFish,代码行数:33,代码来源:PlayerMove.cs

示例9: FixedUpdate

    // Update is called once per frame
    void FixedUpdate()
    {
        rigidbody.AddForce(gravityBoost * down);

        if (Input.touchCount > 0) {

            if (Input.GetTouch(0).position.x > Screen.width/2) {

                rigidbody.AddForce(jumpForceBoost * jumpRightVector);

                if (facing == Facing.Left) {
                    transform.localScale =

                        new Vector3(

                            transform.localScale.x * -1,
                            transform.localScale.y,
                            transform.localScale.z

                            )

                            ;
                    facing = Facing.Right;
                }

            } else {

                rigidbody.AddForce(jumpForceBoost * jumpLeftVector);

                if (facing == Facing.Right) {
                    transform.localScale =

                        new Vector3(

                            transform.localScale.x * -1,
                            transform.localScale.y,
                            transform.localScale.z

                            )

                            ;
                    facing = Facing.Left;
                }

            }

            gameObject.GetComponent<SpriteRenderer>().sprite = pig_wings_down;

        } else {

            gameObject.GetComponent<SpriteRenderer>().sprite = pig_wings_up;

        }

        if (Input.GetKeyDown(KeyCode.Escape)) {
            Debug.Log("Escape key in pig behaviour");
            Application.LoadLevel(0);
        }
    }
开发者ID:hiyijia,项目名称:FlyingPig,代码行数:60,代码来源:PigBehaviour.cs

示例10: Animation

        private TimeSpan timer; // Contador de tempo.

        #endregion Fields

        #region Constructors

        protected Animation(Facing facing, State state)
        {
            timer = TimeSpan.Zero;
            this.color = Color.White;
            this.state = state;
            this.facing = facing;
            this.loopList = new List<Point>();
        }
开发者ID:vitormartins1,项目名称:the-evolution-of-revolution,代码行数:14,代码来源:Animation2D.cs

示例11: Update

 public virtual void Update()
 {
     Facing f = CalculateFacing();
     if (FacingChanged(f))
     {
         FaceDirection = f;
     }
 }
开发者ID:Gornel,项目名称:Overworld,代码行数:8,代码来源:EnemyController.cs

示例12: Application_Place_ValidPlacementParams_Allowed

 void Application_Place_ValidPlacementParams_Allowed(string command, int xInput, int yInput, Facing fInput, 
     [Frozen] Mock<IRobotService> mockRobotService, Application sut)
 {
     sut.ProcessCommand(command);
     mockRobotService.Verify(rs => rs.Place(It.Is<int>(x => x == xInput),
                                              It.Is<int>(y => y == yInput),
                                              It.Is<Facing>(f => f == fInput)), Times.Once());
 }
开发者ID:FinestV,项目名称:RobotTest,代码行数:8,代码来源:ApplicationTests.cs

示例13: ChangeWallInDirection

    void ChangeWallInDirection(Facing direction, WallType newType)
    {
        GrabTilesFromSelection();

        string prefabPath = "";
        Wall newWall = null;

        switch(newType) {
            case WallType.Basic:
                prefabPath = "Assets/Prefabs/Walls/Basic Wall.prefab";
                break;
            case WallType.Laser:
                prefabPath = "Assets/Prefabs/Walls/Laser Wall.prefab";
                break;
            default:
                Debug.Log("No path for replacement prefab!");
                break;
        }

        var prefab = Resources.LoadAssetAtPath(prefabPath, typeof(Wall));

        if (null == prefab) {
            Debug.Log("Replacement prefab not found!");
            return;
        }

        foreach (Tile tile in selectedTiles) {
            Wall wallToChange = tile.adjacentWalls[(int)direction];

            if (null == wallToChange) {
                Debug.Log("Wall doesn't exist in that direction!");
                continue;
            }

            if (wallToChange.wallType == newType) {
                Debug.Log("Existing wall is already this type.");
                continue;
            }

            newWall = (Wall)GameObject.Instantiate(prefab, wallToChange.transform.position, wallToChange.transform.rotation);
            newWall.transform.parent = wallToChange.transform.parent;
            newWall.facing = wallToChange.facing;
            newWall.adjacentTiles = wallToChange.adjacentTiles;
            newWall.Setup();
            TileVisualizer.instance.SetVisualizationForWall(newWall);

            foreach (Tile adjTile in wallToChange.adjacentTiles) {
                if (adjTile.adjacentWalls[(int)direction] == wallToChange) {
                    adjTile.adjacentWalls[(int)direction] = newWall;
                }
                if (adjTile.adjacentWalls[(int)Utils.UTurnFacing(direction)] == wallToChange) {
                    adjTile.adjacentWalls[(int)Utils.UTurnFacing(direction)] = newWall;
                }
            }

            DestroyImmediate(wallToChange.gameObject);
        }
    }
开发者ID:ubiquitous42,项目名称:robots,代码行数:58,代码来源:MapEditWindow.cs

示例14: RobotService_Left_NotPlaced_Ignored

        void RobotService_Left_NotPlaced_Ignored(Facing start, Facing expected, [Frozen]Mock<IRobot> mockRobot, RobotService sut)
        {
            mockRobot.SetupProperty(x => x.Placed, false);
            mockRobot.SetupProperty(x => x.F, start);

            sut.Left();

            mockRobot.VerifySet(r => r.F = expected, Times.Never());
        }
开发者ID:FinestV,项目名称:RobotTest,代码行数:9,代码来源:RobotServiceTests.cs

示例15: RobotService_Left_Placed_Allowed

        void RobotService_Left_Placed_Allowed(Facing start, Facing expected, [Frozen]Mock<IRobot> mockRobot, RobotService sut)
        {
            mockRobot.SetupProperty(x => x.Placed, true);
            mockRobot.SetupProperty(x => x.F, start);

            sut.Left();

            mockRobot.VerifySet(r => r.F = expected, Times.Once());
        }
开发者ID:FinestV,项目名称:RobotTest,代码行数:9,代码来源:RobotServiceTests.cs


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