本文整理汇总了C#中Movement.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Movement.Update方法的具体用法?C# Movement.Update怎么用?C# Movement.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movement
的用法示例。
在下文中一共展示了Movement.Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public override void Update()
{
if (this.dec == null)
this.dec = Entity.decoration;
// Force initial direction update
if (this.movement == null)
{
movement = createTurnMovement(direction);
movement.addProgress(1f); // Move to End
movement.Update(); // Assure finalization
movement.UpdateTextures();
}
// If we're not moving right now
if(!IsMoving){
// Let's see if we have something to do...
next = RoutePlanifier.next(this.Entity);
//Then, let's move :D
if(next != null){
Vector3 myPosition = this.Entity.Position.transform.localPosition,
otherPosition = next.transform.localPosition;
// Define the movement type and set the tilesheet
MovementType type = getMovementTypeTo(next);
this.movement = Movement.createMovement(type, // type
this.Entity, // Entity
this, // Mover
dec, // Decoration
getSpritesheetForMovementType(type), // Sheet
transform.position, // Origin
next.transform.position + new Vector3(0,next.WalkingHeight+transform.localScale.y / 2,0), // Destination
Entity.Position, // Cell Origin
next, // Cell Destination
null); // Extra Params
}
else if (movementEvent != null)
{
movementFinished = true;
if (turnAfterMove)
{
switchDirection(turnDirection);
turnAfterMove = false;
}
}
}
if(IsMoving){
// Update the progress
this.movement.Update();
this.movement.UpdateTextures();
// If the movement has ended
if(this.movement.Ended){
paso = !paso;
}
}
}