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


C# Movement类代码示例

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


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

示例1: setAnimation

 public void setAnimation(Movement.PlayerState newState, float animationSpeed)
 {
     m_actualState = newState;
     m_step = 0;
     m_stepStatus = 0;
     m_animationSpeed = animationSpeed;
 }
开发者ID:Fonserbc,项目名称:ETLYT,代码行数:7,代码来源:AnimationHandler.cs

示例2: ReplaceMoveInput

 public Entity ReplaceMoveInput(Movement newMovement)
 {
     var component = CreateComponent<MoveInputComponent>(ComponentIds.MoveInput);
     component.movement = newMovement;
     ReplaceComponent(ComponentIds.MoveInput, component);
     return this;
 }
开发者ID:JamesMcMahon,项目名称:entitas-2d-roguelike,代码行数:7,代码来源:MoveInputComponentGeneratedExtension.cs

示例3: Start

 // Use this for initialization
 void Start()
 {
     guiText = gameObject.GetComponent<GUIText>();
     textBackground = GameObject.Find("ScoreBackground").GetComponent<GUITexture>();
     mic = GameObject.Find ("Beat Detector").GetComponent<MicrophoneInput>();
     player = GameObject.Find ("Player").GetComponent<Movement>();
 }
开发者ID:dwarfcrank,项目名称:AChangeOfHeart,代码行数:8,代码来源:ScoreText.cs

示例4: Check

 /// <summary>
 /// Check if the next move is possible
 /// </summary>
 /// <param name="position">Current position</param>
 /// <param name="movement">Next movement</param>
 /// <param name="newPosition">If the movement is valid this out parametr holds new location</param>
 /// <returns>Possibility of movement</returns>
 private bool Check(Point position, Movement movement, out Point newPosition)
 {
     Point oldPosition = position;
     switch (movement)
     {
         case Movement.Up:
             position.X--;
             break;
         case Movement.Left:
             position.Y--;
             break;
         case Movement.Down:
             position.X++;
             break;
         case Movement.Right:
             position.Y++;
             break;
         default:
             newPosition = position;
             return false;
     }
     newPosition = position;
     if (position.X <= 0 || position.X >= Playground.playgroundSize - 1 || position.Y <= 0 || position.Y >= Playground.playgroundSize - 1) return false;
     Square square = Program.playground.board[position.X][position.Y];
     if (square == Square.Empty || square == Square.Fire || square == character) return true;
     else return false;
 }
开发者ID:Xsichtik,项目名称:Bomberman,代码行数:34,代码来源:AI.cs

示例5: Alma

 public Alma(int x, int y, Tile.ID type)
     : base(x, y, type)
 {
     AlmaMove = new Movement(Properties.Resources.alma_movement,150);
     dir = Hero.Direction.Down;
     loadRoll();
 }
开发者ID:Easihh,项目名称:C-Sharp-Avenger,代码行数:7,代码来源:Alma.cs

示例6: ExtractMovement

    /* This method extracts the data from the temporary XML object and places it
     * in runtime movement object that will be processed on the spot.
    */
    IEnumerator ExtractMovement(XmlDocument xml)
    {
        Movement movement;

        //Set the name of the test being run in the global variable
        gs.setTestName(xml.SelectSingleNode("Test/Name").InnerText);

        //Move through each tagged item within the xml document
        foreach (XmlNode node in xml.SelectNodes("Test/Movement")){
            movement = new Movement();

            //Extract and assign tagged items within the xmlDoc to object variables within Movement class
            movement.MovementID = node.SelectSingleNode("MovementId").InnerText;
            movement.MovementDesc = node.SelectSingleNode("MovementDesc").InnerText;

            //Assign MovementDetails to Movement Class variables
            foreach (XmlNode detail in node.SelectNodes("MovementDetail")){
                movement.Sequence = detail.SelectSingleNode("SequenceId").InnerText;
                movement.Path = detail.SelectSingleNode("Path").InnerText;
                movement.PathDesc = detail.SelectSingleNode("PathDesc").InnerText;
                movement.Gait = detail.SelectSingleNode("Gait").InnerText;

                //Call LoadMovement Coroutine method and pass movement object
                //and wait for the finish of Coroutine to process further information.
                yield return StartCoroutine(ProcessMovement(movement));
            }
        }
    }
开发者ID:relinko01,项目名称:Dressage,代码行数:31,代码来源:HorseMovement.cs

示例7: Start

 void Start()
 {
     move = (Movement)GetComponent(typeof(Movement));
     rend = (Renderer)GetComponent(typeof(Renderer));
     warming = false;
     oldQuote = 0;
 }
开发者ID:Shentoza,项目名称:GPM,代码行数:7,代码来源:HeatSystem.cs

示例8: Awake

 /// <summary>
 /// 	Get the basics components the player need
 /// </summary>
 void Awake()
 {
     moveEnnemy = GetComponent<Movement>();
     jumpEnnemy = GetComponent<Jump>();
     toHunt = Player.GetComponent<Rigidbody2D> ();
     myself = GetComponent<Rigidbody2D> ();
 }
开发者ID:SneakyRedSnake,项目名称:rogue-shield,代码行数:10,代码来源:EnnemyAI.cs

示例9: Start

	// Use this for initialization
	void Start () {
		currentHealth = topHealth;
		Player = FindObjectOfType<Movement> ();
		//InvokeRepeating ("decreaseHealth", 1f,1f);
		die = FindObjectOfType<Die> ();
		decreaseHealth();
	}
开发者ID:sommercodes,项目名称:Jungle-Escape,代码行数:8,代码来源:PlayerHealth.cs

示例10: Game_AddMove_RaisesIsWonEventWhenAddingWinningMoveOnMainDiagonal

        public void Game_AddMove_RaisesIsWonEventWhenAddingWinningMoveOnMainDiagonal()
        {
            //Arrange
            NotificationEventArgs<Game> argsWhenGameIsWon = null;
            _game.WonGame += new EventHandler<NotificationEventArgs<Game>>((o, e) => { argsWhenGameIsWon = e; });

            Movement m1 = new Movement(0, 0, 'x', _p1, true);
            Movement m2 = new Movement(1, 1, 'x', _p1, true);
            Movement m3 = new Movement(2, 2, 'x', _p1, true);

            Movement m4 = new Movement(0, 1, 'o', _p2, false);
            Movement m5 = new Movement(0, 2, 'o', _p2, false);

            //Act
            bool moveAdded = _game.AddMove(m1, _p1.Id);

            moveAdded = _game.AddMove(m4, _p2.Id);
            moveAdded = _game.AddMove(m5, _p2.Id);

            moveAdded = _game.AddMove(m2, _p1.Id);
            moveAdded = _game.AddMove(m3, _p1.Id);

            //Assert
            Assert.AreEqual<Game>(argsWhenGameIsWon.Value, _game);
            Assert.IsNotNull(_game.Winner);
        }
开发者ID:alexpeta,项目名称:TicTacToeSignalR,代码行数:26,代码来源:GameTests.cs

示例11: OnEnable

 void OnEnable()
 {
     // get relevant components
     playerRigidbody = GameObject.FindWithTag ("Player").GetComponent<Rigidbody> ();
     playerMovement = GameObject.FindWithTag ("Player").GetComponent<Movement> ();
     playerPMat = (PhysicMaterial) Resources.Load ("PhysicMaterials/Ball");
 }
开发者ID:ElectricCatStudios,项目名称:HyperNeon,代码行数:7,代码来源:PlayerPhysics.cs

示例12: Update

    // Update is called once per frame
    void Update()
    {
        if(isMine)
        {
            // get movement direction
            float mX = Input.GetAxis("Horizontal") * moveSpeed;
            float mY = Input.GetAxis("Vertical") * moveSpeed;

            this.transform.position += (new Vector3(mX, 0f, mY))*Time.deltaTime;

            if (Time.time >= timeOfLastMoveCmd + 0.1f && lastReceivedMove != this.transform.position)
            {
                lastReceivedMove = this.transform.position;
                timeOfLastMoveCmd = Time.time;

                // send move command to server every 0.1 seconds
                Dictionary<byte, object> requestDict = new Dictionary<byte, object>();

                Movement moveMent = new Movement();
                moveMent.actorID = actorInfo.actor.actorID;
                moveMent.posX = this.transform.position.x;
                moveMent.posY = this.transform.position.z;

                requestDict.Add((byte)Parameter.Data,LMLiblary.General.GeneralFunc.Serialize(moveMent));

                StarCollectorClient.connection.OpCustom((byte)AckRequestType.MoveCommand, requestDict, false);
                this.GetComponent<CheckRegion>().Load();
            }

            //transform.position = Vector3.Lerp(transform.position,lastReceivedMove, Time.deltaTime * 20f);
        }
    }
开发者ID:anhle128,项目名称:demo_photon_with_unity,代码行数:33,代码来源:ClientPlayer.cs

示例13: IsArcValid

        public static bool IsArcValid (Movement from, Analyzer.Node.Movement to) {
            if (from == Movement.Unknown) {
                return
                    to == Analyzer.Node.Movement.JustDown ||
                    to == Analyzer.Node.Movement.JustDownOrStayDown;
            } else if (from == Movement.Tap) {
                return
                    to == Analyzer.Node.Movement.JustDown ||

                    to == Analyzer.Node.Movement.JustDownOrStayDown;
            } else if (from == Movement.ForceDownStart) {
                return
                    to == Analyzer.Node.Movement.StayDown ||
                    to == Analyzer.Node.Movement.Relax;
            } else if (from == Movement.ForceDown) {
                return
                    to == Analyzer.Node.Movement.StayDown ||

                    to == Analyzer.Node.Movement.Relax;
            } else if (from == Movement.PassiveDown) {
                return
                    to == Analyzer.Node.Movement.JustDown ||
                    to == Analyzer.Node.Movement.JustDownOrStayDown;
            } else {
                throw new ArgumentException();
            }
        }
开发者ID:baguio,项目名称:SSC-AI,代码行数:27,代码来源:MovementHelper.cs

示例14: checkPush

    public bool checkPush(Direction direction, int force)
    {
        GameObject next = faces[(int)direction];
        if (next != null)
        {
            force--;
            if(next.tag == "pushable" && force >= 0)
            {
                attached = next.GetComponent<Movement>();
                if (attached.checkPush(direction, force))
                {
                    moving = direction;
                    return true;
                }else
                {
                    attached = null;
                    return false;
                }

            }
            else
            {
                return false;
            }
        } else
        {
            return true;
        }
    }
开发者ID:GAlexMES,项目名称:GGJ2016-cube_town,代码行数:29,代码来源:Movement.cs

示例15: Awake

 public new void Awake()
 {
     base.Awake();
     myCamera = GameObject.FindGameObjectWithTag("Player1Camera");
     movement = GetComponent<Movement>();
     shipName = name;
 }
开发者ID:rainbee2214,项目名称:TMHTU2015,代码行数:7,代码来源:Ship.cs


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