コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (!player)
     {
         player = GameObject.FindGameObjectWithTag("Player");
     }
     pCheckpoint     = player.GetComponent <CheckpointSystemVehicle>();
     win.enabled     = false;
     wintext.enabled = false;
 }
コード例 #2
0
    void Start()
    {
        playerCS = GameObject.FindGameObjectWithTag("Player").GetComponent <CheckpointSystemVehicle>();
        if (playerCS == null)
        {
            Debug.LogError("Player vehicle does not implement CheckpointSystemVehicle!", gameObject); return;
        }

        leftCheckpointMarker  = Instantiate(activeCheckpointMarker, playerCS.currentCheckpointTarget.leftCheckpointObject.transform);
        rightCheckpointMarker = Instantiate(activeCheckpointMarker, playerCS.currentCheckpointTarget.rightCheckpointObject.transform);

        CheckpointSystemVehicle.onCheckpointTriggeredByPlayer += PlayerUX;
    }
    void Start()
    {
        //verify that checkpoints.list is not empty
        if (Checkpoints.list.Length == 0)
        {
            Debug.LogError("No Checkpoints found in level", gameObject);
        }

        //Get reference to CheckpointSystemVehicle
        checkpointSystem = myVehicle.GetComponent <CheckpointSystemVehicle>();
        //error if checkpointSystem not found
        if (checkpointSystem == null)
        {
            Debug.LogError("Vehicle missing CheckpointSystemVehicle script", gameObject);
        }
    }