Beispiel #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));
        }
    }
Beispiel #2
0
 // ReSharper disable once UnusedMember.Local
 // ReSharper disable once ArrangeTypeMemberModifiers
 // ReSharper disable once InconsistentNaming
 void Start()
 {
     initialize();
     clothRendererInstance = GetComponent <ClothRenderer>();
     clothRendererInstance.controller();
     isInitialized = true;
 }
Beispiel #3
0
    static int _CreateClothRenderer(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            ClothRenderer obj = new ClothRenderer();
            LuaScriptMgr.Push(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: ClothRenderer.New");
        }

        return(0);
    }
Beispiel #4
0
    static int set_pauseWhenNotVisible(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name pauseWhenNotVisible");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index pauseWhenNotVisible on a nil value");
            }
        }

        ClothRenderer obj = (ClothRenderer)o;

        obj.pauseWhenNotVisible = LuaScriptMgr.GetBoolean(L, 3);
        return(0);
    }