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() { //rope.GenerateJointObjects(); if (tube == null) tube = new RopeTubeRenderer(gameObject, false); tube.calculateTangents = true; UpdateMesh(); }
public void OnInitializeMesh() { //rope.GenerateJointObjects(); if (tube == null) { tube = new RopeTubeRenderer(gameObject, false); } tube.calculateTangents = true; UpdateMesh(); }
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)); }