コード例 #1
0
        /// <summary>
        /// Cleanup function
        /// </summary>
        protected virtual void OnDestroy()
        {
            Physics.gravity       = originalGravity;
            Time.fixedDeltaTime   = originalFixedDeltaTime;
            Time.maximumDeltaTime = originalMaximumDeltaTime;
            broadcastHub.Clear();
            broadcastHub = null;
            agentSpawner = null;

            // Signal to listeners that the academy is being destroyed now
            DestroyAction();
        }
コード例 #2
0
        /// <summary>
        /// Lazy initializes the Drawer with the property to be drawn.
        /// </summary>
        /// <param name="property">The SerializedProperty of the BroadcastHub
        /// to make the custom GUI for.</param>
        private void LazyInitializeHub(SerializedProperty property)
        {
            if (m_Hub != null)
            {
                return;
            }
            var target = property.serializedObject.targetObject;

            m_Hub = fieldInfo.GetValue(target) as BroadcastHub;
            if (m_Hub == null)
            {
                m_Hub = new BroadcastHub();
                fieldInfo.SetValue(target, m_Hub);
            }
        }
コード例 #3
0
        /// <summary>
        /// Lazy initializes the Drawer with the property to be drawn.
        /// </summary>
        /// <param name="property">The SerializedProperty of the BroadcastHub
        /// to make the custom GUI for.</param>
        /// <param name="label">The label of this property.</param>
        private void LazyInitializeHub(SerializedProperty property, GUIContent label)
        {
            if (_hub != null)
            {
                return;
            }
            var target = property.serializedObject.targetObject;

            _hub = fieldInfo.GetValue(target) as BroadcastHub;
            if (_hub == null)
            {
                _hub = new BroadcastHub();
                fieldInfo.SetValue(target, _hub);
            }
        }