Example #1
0
 public static void EndCampaign()
 {
     PauseGame.only.endPlay();
     foreach (CampaignManager cm in allCampaigns)
     {
         if (cm == null)
         {
             continue;;
         }
         else
         {
             Destroy(cm.gameObject.transform.parent.gameObject);
         }
     }
     campaign = null;
     // return to pregame manager or quit
     if (PregameManager.exists)
     {
         PregameManager.only.CleanUp();
     }
     else
     {
         QuitClean.QuitGame();
     }
 }
Example #2
0
 public void WrapUp()
 {
     PauseGame.only.endPlay();
     if (PregameManager.exists)
     {
         PregameManager.only.CleanUp();
     }
     else
     {
         QuitClean.QuitGame();
     }
 }
Example #3
0
        // local methods

        public static void BeginCampaign(string _cn_)
        {
            // Called by game (or pregame) manager -- entry point
#if FULLLOG
            MoreDebug.Log(_cn_ + " (" + count + ") " + MoreDebug.splatRow);
#endif

            if (count == 0)
            {
                MoreDebug.LogError("No campaigns registered.");
                QuitClean.QuitGame();
            }

            foreach (CampaignManager cm in allCampaigns)
            {
                if (cm == null)
                {
#if FULLLOG
                    MoreDebug.Log("Null skipped.");
#endif
                    continue;
                }
                else if (cm.CampaignName == _cn_)
                {
#if FULLLOG
                    MoreDebug.Log(cm.CampaignName + " selected.");
#endif
                    campaign          = cm;
                    campaign.isActive = true;
                    campaign.enabled  = true;
#if FULLLOG
                    if (campaign.isActiveAndEnabled)
                    {
                        MoreDebug.Log(campaign.CampaignName + " is active and enabled(tm).");
                    }
                    else
                    {
                        MoreDebug.Log(campaign.CampaignName + " is NOT active and enabled(tm).");
                    }
#endif
                }
                else
                {
#if FULLLOG
                    MoreDebug.Log(cm.CampaignName + " destroyed.");
#endif
                    Destroy(cm.gameObject);
                }
            }
        }