예제 #1
0
    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));
        }
    }
예제 #2
0
    public void OnInitializeMesh()
    {
        //rope.GenerateJointObjects();

        if (tube == null)
            tube = new RopeTubeRenderer(gameObject, false);

        tube.calculateTangents = true;

        UpdateMesh();
    }
예제 #3
0
    public void OnInitializeMesh()
    {
        //rope.GenerateJointObjects();

        if (tube == null)
        {
            tube = new RopeTubeRenderer(gameObject, false);
        }

        tube.calculateTangents = true;

        UpdateMesh();
    }
예제 #4
0
    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));
    }