void DoToolbarGUI()
{
if (MBGUI.DoButton(new GUIContent(mTexClose,"Close Magical Box editor"), true, false))
Close();
GUILayout.Space(10);
if (MBGUI.DoButton(new GUIContent(mTexPlay, "Play ParticleSystem"), SelectedParticleSystem != null, false)) {
if (!SelectedParticleSystem.Paused)
SelectedParticleSystem.Halt();
SelectedParticleSystem.Play();
}
if (MBGUI.DoButton(new GUIContent(mTexStop, "Stop ParticleSystem"), SelectedParticleSystem != null && SelectedParticleSystem.Playing, false))
SelectedParticleSystem.Stop();
if (MBGUI.DoButton(new GUIContent(mTexHalt, "Halt ParticleSystem"), SelectedParticleSystem != null && SelectedParticleSystem.Playing, false))
SelectedParticleSystem.Halt();
GUILayout.Space(10);
if (MBGUI.DoButton(new GUIContent(mTexPlay, "Play Selected"), MBEditorCommands.CanPlayObject(), false))
MBEditorCommands.PlayObject();
if (MBGUI.DoButton(new GUIContent(mTexStop, "Stop Selected"), MBEditorCommands.CanStopObject(), false))
MBEditorCommands.StopObject();
if (MBGUI.DoButton(new GUIContent(mTexHalt, "Halt Selected"), MBEditorCommands.CanHaltObject(), false))
MBEditorCommands.HaltObject();
GUILayout.Space(10);
if (MBGUI.DoButton(new GUIContent(mTexSynchronize, "Resync"), SelectedParticleSystem != null, false))
MBEditorCommands.SyncHierarchy();
// DrawGizmo-Flags
MBGUI.DoLabel("Gizmos:");
bool sys = (mGizmos & MBGizmoFlags.MBParticleSystem) == MBGizmoFlags.MBParticleSystem;
bool anc = (mGizmos & MBGizmoFlags.MBAnchor) == MBGizmoFlags.MBAnchor;
bool em = (mGizmos & MBGizmoFlags.MBEmitter) == MBGizmoFlags.MBEmitter;
bool par = (mGizmos & MBGizmoFlags.MBParameter) == MBGizmoFlags.MBParameter;
sys = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBParticleSystem)), "All ParticleSystems"), sys);
anc = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBAnchor)), "All Anchors"), anc);
em = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBEmitter)), "All Emitters"), em);
par = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBParameter)), "All Parameters"), par);
if (sys)
mGizmos |= MBGizmoFlags.MBParticleSystem;
else
mGizmos &= ~MBGizmoFlags.MBParticleSystem;
if (anc)
mGizmos |= MBGizmoFlags.MBAnchor;
else
mGizmos &= ~MBGizmoFlags.MBAnchor;
if (em)
mGizmos |= MBGizmoFlags.MBEmitter;
else
mGizmos &= ~MBGizmoFlags.MBEmitter;
if (par)
mGizmos |= MBGizmoFlags.MBParameter;
else
mGizmos &= ~MBGizmoFlags.MBParameter;
// DrawGizmoSelected-Flags
MBGUI.DoLabel("Selected:");
sys = (mGizmosSelected & MBGizmoFlags.MBParticleSystem) == MBGizmoFlags.MBParticleSystem;
anc = (mGizmosSelected & MBGizmoFlags.MBAnchor) == MBGizmoFlags.MBAnchor;
em = (mGizmosSelected & MBGizmoFlags.MBEmitter) == MBGizmoFlags.MBEmitter;
par = (mGizmosSelected & MBGizmoFlags.MBParameter) == MBGizmoFlags.MBParameter;
sys = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBParticleSystem)), "Selected ParticleSystem"), sys);
anc = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBAnchor)), "Selected Anchor"), anc);
em = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBEmitter)), "Selected Emitter"), em);
par = MBGUI.DoToggleButton(new GUIContent(ObjectIcon(typeof(MBParameter)), "Selected Parameter"), par);
if (sys)
mGizmosSelected |= MBGizmoFlags.MBParticleSystem;
else
mGizmosSelected &= ~MBGizmoFlags.MBParticleSystem;
if (anc)
mGizmosSelected |= MBGizmoFlags.MBAnchor;
else
mGizmosSelected &= ~MBGizmoFlags.MBAnchor;
if (em)
mGizmosSelected |= MBGizmoFlags.MBEmitter;
else
mGizmosSelected &= ~MBGizmoFlags.MBEmitter;
if (par)
mGizmosSelected |= MBGizmoFlags.MBParameter;
else
mGizmosSelected &= ~MBGizmoFlags.MBParameter;
GUILayout.Space(10);
mAutoSelect = MBGUI.DoToggleButton(new GUIContent(mTexAutoSelect, "Synchronize Hierarchy when using the Overview"), mAutoSelect);
GUILayout.Space(10);
mSlowMotion = MBGUI.DoFloatSliderSmall(new GUIContent(mTexHourglass, "Slow Motion %"), mSlowMotion, 0f, 1f);
mEditorUpdateInterval = MBGUI.DoFloatFieldSmall(new GUIContent(mTexUpdateInterval, "Editor update interval in seconds (0=instant)"), mEditorUpdateInterval,true);
SelectedParticleSystem.mbDrawGizmos = mGizmos;
SelectedParticleSystem.mbDrawGizmosSelected = mGizmosSelected;
}