public Checkpoint(string checkpointNumber, DateTime checkpointTime, string[] checkpointProcessIndicator, string[] checkpointUpdateIndicator, string checkpointCheckMethodIndicator, SimulatorBase checkpointTransferObject, CheckpointArgs checkpointTransferArgs, string checkpointTypeIndicator, bool checkpointConstancy, bool checkpointCanBeSaved) { CheckpointNumber = checkpointNumber; CheckpointTime = checkpointTime; CheckpointProcessIndicators = checkpointProcessIndicator; CheckpointUpdateIndicators = checkpointUpdateIndicator; CheckpointCheckMethodIndicator = checkpointCheckMethodIndicator; CheckpointTransferObject = checkpointTransferObject; CheckpointTransferArgs = checkpointTransferArgs; CheckpointTypeIndicator = checkpointTypeIndicator; CheckpointIsConstant = checkpointConstancy; CheckpointCanBeSaved = checkpointCanBeSaved; _checkFinishMethod = (sender, args) => false; GenerateCheckpoint(); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { currentCP = this; } }
// Use this for initialization void Start() { if (startCheckPoint) { currentCP = this; respawnPlayer(GameObject.FindGameObjectWithTag("Player")); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Player") && !dead) { CheckpointChecker.respawnPlayer(collision.gameObject); transform.position = startPos; onCollisionExtra(); } otherCollisionExtra(collision); }
public Checkpoint(string checkpointNumber, DateTime checkpointTime, string[] checkpointProcessIndicator, string[] checkpointUpdateIndicator, string checkpointCheckMethodIndicator, string checkpointTypeIndicator) { CheckpointNumber = checkpointNumber; CheckpointTime = checkpointTime; CheckpointProcessIndicators = checkpointProcessIndicator; CheckpointUpdateIndicators = checkpointUpdateIndicator; CheckpointCheckMethodIndicator = checkpointCheckMethodIndicator; CheckpointTypeIndicator = checkpointTypeIndicator; _checkFinishMethod = (sender, args) => false; GenerateCheckpoint(); }
/// <summary> /// Resets the player's position after he fails /// </summary> public void respawn() { CheckpointChecker.respawnPlayer(gameObject); }
/// <summary> /// 设置检查方法 /// </summary> /// <param name="checker"></param> public void SetCheckMethod(CheckpointChecker checker) => _checkFinishMethod = checker;