public static Cloth Create(Vector2 scale, int div) { var cloth = new Cloth(); cloth.points = InitializeClothPoints(scale, div); cloth.constraints = InitializeClothConstraints(cloth.points, div); return(cloth); }
/// <summary> /// 布の初期化 /// </summary> void InitializeCloth(Vector2 scale, int div) { var cloth = Cloth.Create(scale, div); // _cloth = cloth; var result = BindBuffer(cloth.points, cloth.constraints); result &= SetUpKernel(); if (!result) { Debug.LogWarning("初期化に失敗しました"); } _isReady = result; }