コード例 #1
0
        private static void CreateRopeObject()
        {
            GameObject ropeObj = new GameObject("New QuickRope");
            QuickRope  rope    = ropeObj.AddComponent <QuickRope>();

            rope.defaultPrefab = null;
            ropeObj.AddComponent <RopeRenderer>();

            Selection.activeGameObject = ropeObj;
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
    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;
    }
コード例 #4
0
 private void Start()
 {
     this.rope = (QuickRope)((Component)this).get_gameObject().GetComponent <QuickRope>();
 }
コード例 #5
0
 void Start()
 {
     rope = gameObject.GetComponent <QuickRope>();
 }