示例#1
0
        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);
        }
示例#2
0
        /// <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;
        }