void DoAnchorGUI()
{
MBAnchor anc = SelectedObject as MBAnchor;
mDetailScroll = EditorGUILayout.BeginScrollView(mDetailScroll);
// GENERAL SECTION
EditorGUILayout.BeginVertical(GUI.skin.GetStyle("Box"));
if (DoSectionHeader("General Settings", mColHeader, true)) {
EditorGUILayout.BeginHorizontal();
string tempname = MBGUI.DoTextField("Name", "", SelectedObject.name);
if (MBGUI.HasChanged) SelectedObject.name = tempname;
EditorGUILayout.EndHorizontal();
anc.PoolingEnabled = MBGUI.DoToggle("Enable Pooling", "Use this anchor as an pooling manager?", anc.PoolingEnabled);
if (anc.PoolingEnabled) {
if (DoSectionHeader("Pooling Manager", mColHeader, true)) {
MBGUI.DoLabel("NOTE: The first child is used as the pool source, so it must be an emitter!", 400, true);
EditorGUILayout.BeginHorizontal();
anc.MinPoolSize = MBGUI.DoIntField("Min Pool Size", "Minimum stock size", anc.MinPoolSize);
anc.MaxPoolSize = MBGUI.DoIntField("Max Pool Size", "Max stock size", anc.MaxPoolSize);
anc.OnMaxPoolSize = (MBAnchorPoolExceededMode)MBGUI.DoEnumField("On Max PoolSize", "Behaviour if max. pool size exceeds", anc.OnMaxPoolSize);
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
anc.AllocationBlockSize = MBGUI.DoIntField("Alloc Block Size", "Items processed at once when the pool needs to grow/shrink", anc.AllocationBlockSize);
anc.AutoDespawn = MBGUI.DoToggle("Auto Despawn", "Despawn emitters automatically when they stops playing", anc.AutoDespawn);
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
anc.AutoCull = MBGUI.DoToggle("Auto Culling", "Cull items automatically", anc.AutoCull);
anc.CullingSpeed = MBGUI.DoFloatField("Culling Speed", "Time between culls in seconds", anc.CullingSpeed);
EditorGUILayout.EndHorizontal();
}
}
}
EditorGUILayout.EndVertical();
EditorGUILayout.EndScrollView();
}