public void Update() { //最简单的状态机 switch switch (_state) { case PlayerState.Null: { ; } break; case PlayerState.Appear: { _curAppearTime += Time.deltaTime; if (_curAppearTime >= AppearTime) { _curAppearTime = AppearTime; _state = PlayerState.Playing; } var pos = Vector3.Lerp(_bornPoint.position, _startPoint.position, _curAppearTime / AppearTime); _plane.transform.position = pos; } break; case PlayerState.Playing: { if (_plane != null) { _plane.transform.position = new Vector2(_plane.transform.position.x, _plane.transform.position.y) + _curSpeed * Time.deltaTime; } _curSpeed = Vector2.zero; } break; case PlayerState.Die: { ; } break; } if (_plane != null) { if (!_plane.IsAlive()) { PlaneDestory(); } } }