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); }
private void Update() { if (m_settings.m_initialiseOnUpdate) { m_settings.m_initialiseOnUpdate = false; Initialise(); CreateSoftBodyFromMesh(); SoftBodyCore core = GetComponent <SoftBodyCore>(); if (core) { core.Initialise(this); } } }
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); } } } }