Esempio n. 1
0
    // If the collision is with a car that can pick this up, get picked up
    private void tryPickupFromCollision(Collider coll)
    {
        if (pickup_delay > 0)
        {
            return;
        }
        GameObject obj      = coll.gameObject;
        car_parts  carParts = obj.GetComponentInParent <car_parts>();

        if (carParts)
        {
            carParts.pickup_part(this.part_type, this.GetComponent <playerID>().p);
            Instantiate(partConfig.dust_cloud).transform.position = transform.position;
            Destroy(gameObject);
            return;
        }
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     playerID = GetComponentInParent <playerID>().p;
     parts    = GetComponentInParent <car_parts>();
 }
Esempio n. 3
0
 private void Start()
 {
     parts        = GetComponentInParent <car_parts>();
     playerid     = GetComponentInParent <playerID>().p;
     creationTime = Time.time;
 }