• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Facing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Start

    /// <summary>
    /// Listen onLeftWall, onRightWall and start moving
    /// </summary>
    override public void Start() {
      base.Start();

      pc2d.onLeftWall += OnLeftWall;
      pc2d.onRightWall += OnRightWall;

      facing = initialFacing;
      input.SetX((float) facing);
    }
开发者ID:llafuente,项目名称:unity-platformer,代码行数:12,代码来源:AIGoomba.cs


示例17: BeginWalkingRight

        // Used in the game ending to force the player to begin moving against its will
        public void BeginWalkingRight()
        {
            playerState = PlayerState.Walk;
            ObjectState = ObjectState.Grounded;
            facing = Facing.Right;
            sprite.PlayAnimation("Walk");

            SetHorizontalSpeed(180f);
        }
开发者ID:cmark89,项目名称:InaneSubterra,代码行数:10,代码来源:Player.cs


示例18: Fire

        public void Fire(Vector2 centerPosition, Facing facing)
        {
            _facing = facing;
            Sprite.TextureAtlas.Frame = _facing == Facing.Right ? 0 : 1;

            MovementVector = _facing == Facing.Right ? new Vector2(12.0f, 0.0f) : new Vector2(-12.0f, 0.0f);

            IsAlive = true;
            CenterPosition = centerPosition;
        }
开发者ID:gmoller,项目名称:SpaceDefender,代码行数:10,代码来源:Bullets.cs


示例19: FacesThisWay

 private static bool FacesThisWay(Vector3 v, Vector3 dir, Facing p, ref float maxDot, ref Facing ret)
 {
     float t = Vector3.Dot(v, dir);
      if (t > maxDot) {
     ret = p;
     maxDot = t;
     return true;
      }
      return false;
 }
开发者ID:daef,项目名称:landmarked,代码行数:10,代码来源:Calculator.cs


示例20: Fire

        public void Fire(Vector2 position, Facing facing, Character user)
        {
            if (this.FireRate < this.WeaponType.FireRate)
                return;

            Bullet bullet = this.WeaponType.BulletType.Pool.New();
            bullet.Fire(position, facing, user);
            GameManager.BulletLayer.AddChild(bullet);

            this.FireRate = 0;
        }
开发者ID:broding,项目名称:bunkerhunter,代码行数:11,代码来源:Weapon.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FactMemento类代码示例发布时间:2022-05-24
下一篇:
C# FacebookDelegate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap