Пример #1
0
 void OnDestroy()
 {
     if (_simulator != null)
     {
         _simulator.Dispose();
         _simulator = null;
     }
     GetComponent <MeshRenderer>().sharedMaterial.DisableKeyword("_INPUT_WORLD_VERTEX");
 }
Пример #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);
     }
 }