Inheritance: MonoBehaviour
Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     PV = GetComponent <PhotonView>();
     transform.SetParent(GameObject.Find("Players").transform);
     grapplePoints          = GameObject.Find("GrapplePoints");
     mainCamera             = GameObject.Find("Main Camera").GetComponent <Camera>();
     _distanceJoint.enabled = false;
     rb       = GetComponent <Rigidbody2D>();
     drawRope = GetComponent <DrawRope>();
     _lineRenderer.enabled = true;
     BoostEncapsulator     = GameObject.Find("BoostBar");
     BoostBar          = BoostEncapsulator.transform.GetChild(1).gameObject;
     BrakeEncapsulator = GameObject.Find("BrakeBar");
     BrakeBar          = BrakeEncapsulator.transform.GetChild(1).gameObject;
     playerTrail       = transform.GetChild(0).GetComponent <TrailRenderer>();
     scoreText         = GameObject.Find("ScoreText").GetComponent <Text>();
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        LineRenderer lr = gameObject.AddComponent<LineRenderer>();
        lr.material = mat;
        lr.SetWidth(0.03f, 0.03f);

        draw = gameObject.AddComponent<DrawRope>();
        draw.links = new Transform[joint_no+1];

        Generate(joint_no);
        //Physics.IgnoreLayerCollision(8, 8);
    }