本文整理汇总了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;
}
示例2: ReplaceMoveInput
public Entity ReplaceMoveInput(Movement newMovement)
{
var component = CreateComponent<MoveInputComponent>(ComponentIds.MoveInput);
component.movement = newMovement;
ReplaceComponent(ComponentIds.MoveInput, component);
return this;
}
示例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>();
}
示例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;
}
示例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();
}
示例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));
}
}
}
示例7: Start
void Start()
{
move = (Movement)GetComponent(typeof(Movement));
rend = (Renderer)GetComponent(typeof(Renderer));
warming = false;
oldQuote = 0;
}
示例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> ();
}
示例9: Start
// Use this for initialization
void Start () {
currentHealth = topHealth;
Player = FindObjectOfType<Movement> ();
//InvokeRepeating ("decreaseHealth", 1f,1f);
die = FindObjectOfType<Die> ();
decreaseHealth();
}
示例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);
}
示例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");
}
示例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);
}
}
示例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();
}
}
示例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;
}
}
示例15: Awake
public new void Awake()
{
base.Awake();
myCamera = GameObject.FindGameObjectWithTag("Player1Camera");
movement = GetComponent<Movement>();
shipName = name;
}