示例#1
0
 // Use this for initialization
 void Start()
 {
     zOffset = new Vector3(0.0f, 0.0f, -10.0f);
     cam     = GetComponent <Camera>();
     if (follow != null)
     {
         car = follow.GetComponent <Car2D>();
         rb  = follow.GetComponent <Rigidbody2D>();
     }
 }
示例#2
0
    // Use this for initialization
    void Start()
    {
        //layerMask = Physics2D.GetLayerCollisionMask(gameObject.layer);
        checkpoints = GameObject.Find("Training Manager").GetComponent <TrainingManager>().checkpoints;   // What the f**k is this mess?
        car         = gameObject.GetComponent <Car2D>();
        rb          = gameObject.GetComponent <Rigidbody2D>();

        checkpointTime = 20.0f;
        lap            = 1;
        lastLap        = lap;
        lastCheckpoint = 0;
        nextCheckpoint = 1;

        layers[0] = numberOfSightLines * 2 + EXTRA_INPUTS;

        raycastDistances = new float[numberOfSightLines];
        Run();
    }
示例#3
0
 public void ChangeTarget(GameObject target)
 {
     follow = target;
     car    = target.GetComponent <Car2D>();
     rb     = target.GetComponent <Rigidbody2D>();
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     car = gameObject.GetComponent <Car2D>();
 }
示例#5
0
 void Awake()
 {
     rb  = GetComponent <Rigidbody2D>();
     car = GetComponent <Car2D>();
 }