コード例 #1
0
        /// <summary>
        /// When enabled and native instance isn't enabled, enable shape/geometry
        /// and update mass properties (if rigid body is present).
        /// </summary>
        /// <remarks>
        /// This callback is executed when pressing 'Play' or starting an application.
        /// </remarks>
        protected override void OnEnable()
        {
            if (m_geometry != null && !m_geometry.getEnable())
            {
                m_geometry.setEnable(true);

                var rb = RigidBody;
                if (rb != null && rb.Native != null)
                {
                    rb.UpdateMassProperties();
                }
            }
        }