Exemplo n.º 1
0
 void OnDestroy()
 {
     if (_simulator != null)
     {
         _simulator.Dispose();
         _simulator = null;
     }
     GetComponent <MeshRenderer>().sharedMaterial.DisableKeyword("_INPUT_WORLD_VERTEX");
 }
Exemplo n.º 2
0
 void Awake()
 {
     _meshFilter            = GetComponent <MeshFilter>();
     _meshFilter.sharedMesh = Object.Instantiate(_meshFilter.sharedMesh);
     _mesh         = _meshFilter.sharedMesh;
     _meshModifier = ClothMeshModifier.CreateFromMeshFilter(_meshFilter);
     _simulator    = new ClothSimulator(_meshModifier, this.setting);
     foreach (var c in colliderProxies)
     {
         _simulator.AddCollider(c);
     }
 }