コード例 #1
0
        public static void MakeObjectSoftbodyChain(GameObject _object, Chain _chain, SoftBodySettings _settings)
        {
            SoftBodyMesh mesh = _object.AddComponent <SoftBodyMesh>();

            mesh.Initialise(_object.GetComponent <MeshFilter>(), _settings);
            mesh.CreateSoftBodyFromChain(_chain);

            SoftBodyCore core = _object.AddComponent <SoftBodyCore>();

            core.Initialise(mesh);
        }
コード例 #2
0
        private void Update()
        {
            if (m_settings.m_initialiseOnUpdate)
            {
                m_settings.m_initialiseOnUpdate = false;
                Initialise();
                CreateSoftBodyFromMesh();

                SoftBodyCore core = GetComponent <SoftBodyCore>();
                if (core)
                {
                    core.Initialise(this);
                }
            }
        }
コード例 #3
0
        private void Start()
        {
            //Initalises SBmesh and SBCore on Start
            if (m_settings != null)
            {
                if (m_settings.m_initialiseOnStart)
                {
                    Initialise();
                    CreateSoftBodyFromMesh();

                    SoftBodyCore core = GetComponent <SoftBodyCore>();
                    if (core)
                    {
                        core.Initialise(this);
                    }
                }
            }
        }