Пример #1
0
        public static Vector3 GetPosition(this ClothParticleSystem physicSystem, int index)
        {
            float x, y, z;

            physicSystem.GetPosition(index, out x, out y, out z);

            return(new Vector3(x, y, z));
        }
        private void FixedUpdate()
        {
            for (int i = 0; i < m_clothParticleObjects.Length; ++i)
            {
                m_clothParticleSystem.SetPosition(i, m_clothParticleObjects[i].transform.position);
            }

            m_clothParticleSystem.Step(Time.fixedDeltaTime);

            for (int i = 0; i < m_clothParticleObjects.Length; ++i)
            {
                m_clothParticleObjects[i].transform.position = m_clothParticleSystem.GetPosition(i);
            }
        }