Пример #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));
    }