void Start() { resetPlayerZ(); animatorController = GetComponent <PlayerAnimationController>(); boxUpdate = new PlayerBoxUpdate(); boxUpdate.Init(transform, GetComponent <PlayerColliderBox>(), GetComponent <PlayerBeHurtBox>(), GetComponent <PlayerExploreBox>()); colliderBox = GetComponent <PlayerColliderBox>(); //一开始就对玩家的位置进行修正 target(transform.position, PlayerDirection.Down, PlayerState.Idle); boxUpdate.Update(popDirection); Debug.Log("New Position " + transform.position.x + " " + transform.position.y); }
void Update() { boxUpdate.prePosition = transform.position; updateMovement(); boxUpdate.Update(popDirection); }