private void MoveToScreen(BrainCloudFunction in_fn) { switch (in_fn) { case BrainCloudFunction.FN_ENTITY: m_screen = new ScreenEntity(); break; case BrainCloudFunction.FN_ENTITY_CUSTOM_CLASS: m_screen = new ScreenEntityCustomClass(); break; case BrainCloudFunction.FN_PLAYER_XP_CURRENCY: m_screen = new ScreenPlayerXp(); break; case BrainCloudFunction.FN_PLAYER_STATS: m_screen = new ScreenPlayerStats(); break; case BrainCloudFunction.FN_GLOBAL_STATS: m_screen = new ScreenGlobalStats(); break; case BrainCloudFunction.FN_CLOUD_CODE: m_screen = new ScreenCloudCode(); break; case BrainCloudFunction.FN_IDENTITY: m_screen = new ScreenIdentity(); break; } m_bcFunc = in_fn; m_screen.SetMainScene(this); m_screen.Activate(); }
// lays out the top toolbar + player info void OnGUITopButtons() { GUILayout.BeginHorizontal(); GUILayout.Box("Select a BrainCloud Function:"); BrainCloudFunction fn = (BrainCloudFunction)GUILayout.Toolbar((int)m_bcFunc, m_bcFuncLabels); GUILayout.EndHorizontal(); // if user selected another screen, move to it if (fn != m_bcFunc) { MoveToScreen(fn); } }