private static void CreateRopeObject() { GameObject ropeObj = new GameObject("New QuickRope"); QuickRope rope = ropeObj.AddComponent <QuickRope>(); rope.defaultPrefab = null; ropeObj.AddComponent <RopeRenderer>(); Selection.activeGameObject = ropeObj; }
private void Awake() { this.rope = (QuickRope)((Component)this).GetComponent <QuickRope>(); if (this.rope.Spline.IsLooped) { ((Behaviour)this).set_enabled(false); } else { this.rope.minLinkCount = this.minJointCount; if (!this.rope.canResize) { this.rope.maxLinkCount = this.rope.Links.Length + 1; this.rope.canResize = true; this.rope.Generate(); } this.rope.Links[this.rope.Links.Length - 1].Rigidbody.set_isKinematic(true); } }
void Awake() { rope = GetComponent <QuickRope>(); if (rope.Spline.IsLooped) { enabled = false; return; } rope.minLinkCount = minJointCount; if (!rope.canResize) { rope.maxLinkCount = rope.Links.Length + 1; rope.canResize = true; rope.Generate(); } rope.Links[rope.Links.Length - 1].Rigidbody.isKinematic = true; }
private void Start() { this.rope = (QuickRope)((Component)this).get_gameObject().GetComponent <QuickRope>(); }
void Start() { rope = gameObject.GetComponent <QuickRope>(); }