public void destroy()
        {
            abandonedButton.SetActive(false);
            burnedButton.SetActive(false);
            audioButton.SetActive(false);
            abandonedButton = burnedButton = audioButton = null;

            if (UserInterface.bulldozeAudioClip != null)
            {
                UserInterface.toggleEffects();
            }

            if (data.needSave)
            {
                try {
                    XmlSerializer serializer = new XmlSerializer(typeof(XmlData));
                    using (StreamWriter writer = new StreamWriter("V10Bulldoze.xml")) {
                        serializer.Serialize(writer, data);
                        writer.Flush();
                        writer.Close();
                    }
                } catch (Exception e) {
                    Debug.Log("V10Bulldoze: " + e.GetType().Name + " while writing xml file: " + e.Message + "\n" + e.StackTrace);
                    if (e.InnerException != null)
                    {
                        Debug.Log("Caused by: " + e.InnerException.GetType().Name + ": " + e.InnerException.Message + "\n" + e.InnerException.StackTrace);
                    }
                }
            }

            data = null;
        }
Exemple #2
0
 public override void OnLevelLoaded(LoadMode mode)
 {
     if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame)
     {
         SkylinesOverwatch.Settings.Instance.Enable.BuildingMonitor = V10Bulldoze.active = true;
         V10Bulldoze.ui = new UserInterface();
         if (V10Bulldoze.ui.data.disableEffect)
         {
             UserInterface.toggleEffects();
         }
     }
 }