public void OnInitializeMesh() { rope.GenerateJointObjects(); if (tube == null) { tube = new RopeTubeRenderer(gameObject, true); } mRender = gameObject.GetComponent <ClothRenderer>(); if (mRender == null) { mRender = gameObject.AddComponent <ClothRenderer>(); } mFilter = gameObject.GetComponent <InteractiveCloth>(); if (mFilter == null) { mFilter = gameObject.AddComponent <InteractiveCloth>(); } GenerateMesh(); //if (useAutoTextureTiling) // gameObject.GetComponent<ClothRenderer>().sharedMaterial.mainTextureScale = new Vector2(rope.Joints.Count / 2f, 1); if (gameObject.GetComponent <ClothRenderer>().sharedMaterial == null) { gameObject.GetComponent <ClothRenderer>().sharedMaterial = (Material)Resources.Load("Materials/Rope", typeof(Material)); } }
public void OnInitializeMesh() { if (!prefab) { return; } //rope.FirstJointAlternated = firstJointAlternated; //rope.AlternateJoints = alternateJoints; rope.JointPrefab = prefab; //rope.AlternateJoints = true; rope.JointScale = jointScale; rope.GenerateJointObjects(); }
public void OnInitializeMesh() { if (rope == null) { return; } rope.GenerateJointObjects(); Update(); if (useAutoTextureTiling) { gameObject.GetComponent <LineRenderer>().sharedMaterial.mainTextureScale = new Vector2(rope.Joints.Count / 2f, 1); } }