public ScreenManager()
 {
     CurrentScreen = new SplashScreen();
     xmlGameScreenManager = new XMLManager<GameScreen>();
     xmlGameScreenManager.Type = CurrentScreen.Type;
     CurrentScreen = xmlGameScreenManager.Load(Path.Combine(ScreensConfig.PathToConfigFolder,
         CurrentScreen.Type.Name + "." + ScreensConfig.FileExtension));
 }
Ejemplo n.º 2
0
 private void menu_OnMenuChange(object sender, EventArgs e)
 {
     XMLManager<Menu> xmlMenuManager = new XMLManager<Menu>();
     menu.UnloadContent();
     // transition
     menu = xmlMenuManager.Load(menu.ID);
     menu.LoadContent();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     XMLManager<StateManager> xml = new XMLManager<StateManager>();
     InputManager = new InputManager();
     StateManager = xml.Load("../../../Load/StateManager.xml");
     this.graphics.PreferredBackBufferWidth = (int)StateManager.CurrentState.Dimensions.X;
     this.graphics.PreferredBackBufferHeight = (int)StateManager.CurrentState.Dimensions.Y;
     this.graphics.ApplyChanges();
     base.Initialize();
 }
        //everything that is added with menuChange will triggure this  method
        private void Menu_OnMenuChange(object sender, EventArgs e)
        {
            XMLManager<Menu> xmlManager = new XMLManager<Menu>();
            menu.UnloadContent();
            menu = xmlManager.Load(menu.Id);//we r loading brand new menu
            menu.LoadContent();
            menu.OnMenuChange += Menu_OnMenuChange;
            menu.Transition(0.0f);

            foreach (MenuItem item in menu.Items)
            {
                item.Image.StoreEffects();
                item.Image.ActivateEffect("FadeEffect");
            }
        }
Ejemplo n.º 5
0
 void  LoadComplete()
 {
     XMLManager.LoadXML("file:///" + Application.dataPath + "/File/Enemy.xml");
     XMLManager.LoadXML("file:///" + Application.dataPath + "/File/Language.xml");
     CreateEnmy.Instance().CreatEnmy();
 }
        public override void LoadContent()
        {
            base.LoadContent();
            LoadMapMatrix();
            if (Background != null)
                Background.LoadContent();

            XMLManager<Player> playerLoader = new XMLManager<Player>();
            player = playerLoader.Load(Path.Combine(CharactersConfig.MainCharLoadPath, "Beat.xml"));
            player.LoadContent();

            //if (Texture != null)
            //    CollisionRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height);
        }
Ejemplo n.º 7
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 8
0
 public void LoadData()
 {
     xmlSaved         = Streamdata();
     testInt          = xmlSaved.number;
     testPos.position = xmlSaved.position;
 }
Ejemplo n.º 9
0
 private void Start()
 {
     single     = Single.instance;
     xMLManager = XMLManager.ins;
     audio      = this.gameObject.GetComponent <AudioSource>();
 }
Ejemplo n.º 10
0
        /// <summary>Serialize the theme contents to a string.</summary>
        /// <param name="themeInformation">The information.</param>
        /// <param name="colorPalette">The color palette.</param>
        /// <returns>The <see cref="string" />.</returns>
        public static string Serialize(ThemeInformation themeInformation, ColorPalette colorPalette)
        {
            const string Header      = @"VisualPlus-Theme";
            const string Information = @"Information";
            const string StyleTable  = @"StyleTable";
            const string Shared      = @"Shared";
            const string Toolkit     = @"Toolkit";

            string serializedXML;

            // TODO: Simplify to decompose body.
            using (MemoryStream outputStream = new MemoryStream())
            {
                using (XmlWriter xmlWriter = XmlWriter.Create(outputStream, XMLManager.WriterSettings()))
                {
                    xmlWriter.WriteStartDocument();
                    xmlWriter.WriteWhitespace("\n\n");

                    // Write main theme header
                    xmlWriter.WriteStartElement(Header);

                    // Write theme information header.
                    var themeDataDictionary = new Dictionary <string, string> {
                        { "Name", themeInformation.Name }, { "Author", themeInformation.Author }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, Information, themeDataDictionary);

                    // Write theme style table header.
                    xmlWriter.WriteStartElement(StyleTable);

                    // Write theme shared.
                    xmlWriter.WriteStartElement(Shared);

                    var borderDictionary = new Dictionary <string, Color> {
                        { "Normal", colorPalette.BorderNormal }, { "Hover", colorPalette.BorderHover }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Border", borderDictionary);

                    var columnHeaderDictionary = new Dictionary <string, Color> {
                        { "Header", colorPalette.ColumnHeader }, { "Text", colorPalette.ColumnText }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ColumnHeader", columnHeaderDictionary);

                    var controlDictionary = new Dictionary <string, Color> {
                        { "Enabled", colorPalette.ControlEnabled }, { "Disabled", colorPalette.ControlDisabled }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Control", controlDictionary);

                    var flatControlDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.ElementDisabled }, { "Enabled", colorPalette.ElementEnabled }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Element", flatControlDictionary);

                    var textDictionary = new Dictionary <string, Color>
                    {
                        { "Disabled", colorPalette.TextDisabled },
                        { "Enabled", colorPalette.TextEnabled },
                        { "Hover", colorPalette.TextHover },
                        { "Pressed", colorPalette.TextPressed },
                        { "Selected", colorPalette.Selected },
                        { "Subscript", colorPalette.SubscriptColor },
                        { "Superscript", colorPalette.SuperscriptColor },
                        { "TextLight", colorPalette.TextLight }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Text", textDictionary);

                    var listItemDictionary = new Dictionary <string, Color> {
                        { "Normal", colorPalette.Item }, { "Hover", colorPalette.ItemHover }, { "Selected", colorPalette.ItemSelected }, { "Alternate", colorPalette.ItemAlternate }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ListItem", listItemDictionary);

                    var hatchDictionary = new Dictionary <string, Color> {
                        { "BackColor", colorPalette.HatchBackColor }, { "ForeColor", colorPalette.HatchForeColor }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Hatch", hatchDictionary);

                    var progressDictionary = new Dictionary <string, Color> {
                        { "Background", colorPalette.ProgressBackground }, { "Working", colorPalette.Progress }, { "Disabled", colorPalette.ProgressDisabled }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ProgressBar", progressDictionary);

                    var tabPageDictionary = new Dictionary <string, Color> {
                        { "Enabled", colorPalette.TabPageEnabled }, { "Disabled", colorPalette.TabPageDisabled }, { "Selected", colorPalette.TabPageSelected }, { "Hover", colorPalette.TabPageHover }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "TabPage", tabPageDictionary);

                    var watermarkDictionary = new Dictionary <string, Color> {
                        { "Active", colorPalette.WatermarkActive }, { "Inactive", colorPalette.WatermarkInactive }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Watermark", watermarkDictionary);

                    // End shared.
                    xmlWriter.WriteEndElement();

                    // Write theme toolkit.
                    xmlWriter.WriteStartElement(Toolkit);

                    var visualButton = new Dictionary <string, Color> {
                        { "Enabled", colorPalette.Enabled }, { "Disabled", colorPalette.Disabled }, { "Hover", colorPalette.Hover }, { "Pressed", colorPalette.Pressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualButton", visualButton);

                    var visualComboBox = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.VisualComboBoxDisabled }, { "Enabled", colorPalette.VisualComboBoxEnabled }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualComboBox", visualComboBox);

                    xmlWriter.WriteStartElement("VisualControlBox");

                    xmlWriter.WriteStartElement("HelpButton");

                    var helpBackDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.HelpButtonBackDisabled }, { "Enabled", colorPalette.HelpButtonBackEnabled }, { "Hover", colorPalette.HelpButtonBackHover }, { "Pressed", colorPalette.HelpButtonBackPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "BackColorState", helpBackDictionary);

                    var helpForeDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.HelpButtonForeDisabled }, { "Enabled", colorPalette.HelpButtonForeEnabled }, { "Hover", colorPalette.HelpButtonForeHover }, { "Pressed", colorPalette.HelpButtonForePressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ForeColorState", helpForeDictionary);

                    // End Help Button
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteStartElement("MinimizeButton");

                    var minBackDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.MinimizeButtonBackDisabled }, { "Enabled", colorPalette.MinimizeButtonBackEnabled }, { "Hover", colorPalette.MinimizeButtonBackHover }, { "Pressed", colorPalette.MinimizeButtonBackPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "BackColorState", minBackDictionary);

                    var minForeDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.MinimizeButtonForeDisabled }, { "Enabled", colorPalette.MinimizeButtonForeEnabled }, { "Hover", colorPalette.MinimizeButtonForeHover }, { "Pressed", colorPalette.MinimizeButtonForePressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ForeColorState", minForeDictionary);

                    // End Minimize Button
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteStartElement("MaximizeButton");

                    var maxBackDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.MaximizeButtonBackDisabled }, { "Enabled", colorPalette.MaximizeButtonBackEnabled }, { "Hover", colorPalette.MaximizeButtonBackHover }, { "Pressed", colorPalette.MaximizeButtonBackPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "BackColorState", maxBackDictionary);

                    var maxForeDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.MaximizeButtonForeDisabled }, { "Enabled", colorPalette.MaximizeButtonForeEnabled }, { "Hover", colorPalette.MaximizeButtonForeHover }, { "Pressed", colorPalette.MaximizeButtonForePressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ForeColorState", maxForeDictionary);

                    // End Maximize Button
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteStartElement("CloseButton");

                    var closeBackDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.CloseButtonBackDisabled }, { "Enabled", colorPalette.CloseButtonBackEnabled }, { "Hover", colorPalette.CloseButtonBackHover }, { "Pressed", colorPalette.CloseButtonBackPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "BackColorState", closeBackDictionary);

                    var closeForeDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.CloseButtonForeDisabled }, { "Enabled", colorPalette.CloseButtonForeEnabled }, { "Hover", colorPalette.CloseButtonForeHover }, { "Pressed", colorPalette.CloseButtonForePressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "ForeColorState", closeForeDictionary);

                    // End Close Button
                    xmlWriter.WriteEndElement();

                    // End VisualControlBox
                    xmlWriter.WriteEndElement();

                    var formDictionary = new Dictionary <string, Color> {
                        { "Background", colorPalette.FormBackground }, { "WindowBar", colorPalette.FormWindowBar }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualForm", formDictionary);

                    var radialDictionary = new Dictionary <string, Color> {
                        { "BackCircle", colorPalette.BackCircle }, { "ForeCircle", colorPalette.ForeCircle }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualRadialProgress", radialDictionary);

                    xmlWriter.WriteStartElement("VisualScrollBar");

                    var barDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.ScrollBarDisabled }, { "Enabled", colorPalette.ScrollBarEnabled }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Bar", barDictionary);

                    var scrollButtonDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.ScrollButtonDisabled }, { "Enabled", colorPalette.ScrollButtonEnabled }, { "Hover", colorPalette.ScrollButtonHover }, { "Pressed", colorPalette.ScrollButtonPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Button", scrollButtonDictionary);

                    var scrollThumbDictionary = new Dictionary <string, Color> {
                        { "Disabled", colorPalette.ScrollThumbDisabled }, { "Enabled", colorPalette.ScrollThumbEnabled }, { "Hover", colorPalette.ScrollThumbHover }, { "Pressed", colorPalette.ScrollThumbPressed }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "Thumb", scrollThumbDictionary);

                    // End visual scrollbar.
                    xmlWriter.WriteEndElement();

                    var visualRating = new Dictionary <string, Color> {
                        { "Star", colorPalette.Star }, { "Border", colorPalette.StarBorder }, { "Dull", colorPalette.StarDull }, { "DullBorder", colorPalette.StarDullBorder }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualRating", visualRating);

                    var visualSeparator = new Dictionary <string, Color> {
                        { "Line", colorPalette.VisualSeparatorLine }, { "Shadow", colorPalette.VisualSeparatorShadow }
                    };

                    XMLManager.WriteElementGroup(xmlWriter, "VisualSeparator", visualSeparator);

                    // End toolkit.
                    xmlWriter.WriteEndElement();

                    // End Style table.
                    xmlWriter.WriteEndElement();

                    // End main header.
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteEndDocument();
                }

                serializedXML = Encoding.Default.GetString(outputStream.ToArray());
            }

            return(serializedXML);
        }
Ejemplo n.º 11
0
 private void Awake()
 {
     StartCoroutine(XMLManager.GetInstance().LoadGameData(Application.streamingAssetsPath + "/XML/gameData.xml"));
     StartCoroutine(XMLManager.GetInstance().LoadCharacters(Application.streamingAssetsPath + "/XML/characterData.xml"));
 }
Ejemplo n.º 12
0
 public static void SetProfiles()
 {
     profiles = XMLManager.LoadProfiles();
     profiles.Sort((x, y) => DateTime.Compare(y.GetLastAuth(), x.GetLastAuth()));
 }
Ejemplo n.º 13
0
 //Loads saved games via XML
 public void LoadGame(int saveNo)
 {
     XMLManager.LoadGame(saveNo);
 }
Ejemplo n.º 14
0
 private void Awake()
 {
     instance = this;
 }
 private void Start()
 {
     instance = this;
 }
Ejemplo n.º 16
0
 public void DiscardChanges()
 {
     sfxSlider.value          = XMLManager.GetVolume("SFX");
     masterVolumeSlider.value = XMLManager.GetVolume("Master");
     musicSlider.value        = XMLManager.GetVolume("Music");
 }
Ejemplo n.º 17
0
 public void ApplySettings()
 {
     XMLManager.SaveAudioSetting("Master", masterVolumeSlider.value);
     XMLManager.SaveAudioSetting("Music", musicSlider.value);
     XMLManager.SaveAudioSetting("SFX", sfxSlider.value);
 }
Ejemplo n.º 18
0
    private void OnIncomingData(string data)
    {
        Debug.Log(data + "Onincomingdata in client");
        int serveridx;
        int index = new int();

        serveridx = int.Parse(data.Split('|')[data.Split('|').Length - 1]);
        if (data.Contains("&Enter"))
        {
            int roomid = int.Parse(data.Split('|')[2]);
            for (int i = 0; i < XMLManager.clienttotalroomcnt; i++)
            {
                if (XMLManager.totalroom[i].serveridx == roomid)
                {
                    return;
                }
            }
            itemDisplay.makeroom(data.Split('|')[1]);;
            XMLManager.makeroom(data.Split('|')[1], roomid);
            return;
        }
        if (data.Contains("&MakeRoom"))
        {
            itemDisplay.makeroom(data.Split('|')[1]);
            XMLManager.makeroom(data.Split('|')[1], int.Parse(data.Split('|')[2]));
            return;
        }
        if (data.Contains("&Pricerequest"))
        {
            int totalprice, peapleNum;
            totalprice = int.Parse(data.Split('|')[1]);
            peapleNum  = int.Parse(data.Split('|')[2]);
            int childcount;
            int priceperperson = (totalprice / peapleNum);
            childcount = GameObject.Find("ChatCanvas(Clone)").transform.childCount;
            GameObject.Find("ChatCanvas(Clone)").transform.GetChild(childcount - 1).GetChild(0).GetChild(0).GetChild(0).GetComponent <Text>().text = "총금액 : " + totalprice.ToString() + "원";
            GameObject.Find("ChatCanvas(Clone)").transform.GetChild(childcount - 1).GetChild(0).GetChild(0).GetChild(1).GetComponent <Text>().text = "총인원 : " + peapleNum.ToString() + "명";
            GameObject.Find("ChatCanvas(Clone)").transform.GetChild(childcount - 1).GetChild(0).GetChild(0).GetChild(2).GetComponent <Text>().text = "1인당 계산시 : " + priceperperson.ToString() + "원";
            //GameObject.Find("ChatCanvas(Clone)").transform.GetChild(childcount - 1).GetChild(0).GetChild(0).GetChild(3).GetComponent<Text>().text = "남은 금액 : " + priceperperson.ToString() + "원";
            return;
        }
        if (data.Contains("&Gps"))
        {
            Debug.Log("gps from server in client");

            XMLManager = scenemanager.GetComponent <XMLManager>();


            for (int i = 0; i < 3; i++)
            {
                XMLManager.userDB.chatlist[i].chatroomname = data.Split('|')[i * 3 + 1] + "    거리 : " + data.Split('|')[i * 3 + 2] + "미터";
                XMLManager.userDB.chatlist[i].serveridx    = int.Parse(data.Split('|')[i * 3 + 3]);
                Debug.Log(XMLManager.userDB.chatlist[i].serveridx + " at " + i + "chatlist.serveridx");
            }

            Debug.Log("@@@@@@@@@@@@@5" + XMLManager.userDB.chatlist[0].chatroomname + XMLManager.userDB.chatlist[1].chatroomname + XMLManager.userDB.chatlist[2].chatroomname);
            Debug.Log("gps from server in client check1");
            mode.transform.GetChild(3).transform.GetChild(0).transform.GetChild(0).transform.GetChild(0).GetComponent <Text>().text = XMLManager.userDB.chatlist[0].chatroomname;
            mode.transform.GetChild(3).transform.GetChild(0).transform.GetChild(1).transform.GetChild(0).GetComponent <Text>().text = XMLManager.userDB.chatlist[1].chatroomname;
            mode.transform.GetChild(3).transform.GetChild(0).transform.GetChild(2).transform.GetChild(0).GetComponent <Text>().text = XMLManager.userDB.chatlist[2].chatroomname;

            return;
        }
        GameObject tmpchatcontainer = chatContainer;

        for (int i = 0; i < XMLManager.userDB.chatlist.Count; i++)
        {
            if (XMLManager.userDB.chatlist[i].serveridx == serveridx)
            {
                index = i;
            }
        }
        chatContainer = GameObject.Find("Total").transform.GetChild(1).GetChild(index).GetChild(1).GetChild(0).gameObject;
        if (data == "%NAME")
        {
            Send("&NAME|" + clientName);

            return;
        }
        for (int i = 0; i < XMLManager.userDB.chatlist.Count; i++)
        {
            if (XMLManager.userDB.chatlist[i].serveridx == serverid)
            {
                clientid = XMLManager.userDB.chatlist[i].clientidx;
                int mcnt = chatContainer.transform.childCount;
                mcnt++;
                messangeCnt[clientid]++;
                chatContainer.GetComponent <RectTransform>().sizeDelta = new Vector2(chatContainer.GetComponent <RectTransform>().sizeDelta.x, chatContainer.GetComponent <RectTransform>().sizeDelta.y + 100);

                GameObject go = Instantiate(messagePrefab, chatContainer.transform) as GameObject;
                go.GetComponent <RectTransform>().localPosition = new Vector3(0, -mcnt * 100, 0);
                if (data.Contains("&CHAT"))
                {
                    if (data.Split('|')[0] == clientName)
                    {
                        go.transform.GetChild(0).GetComponent <Image>().color = Color.yellow;
                        go.GetComponent <RectTransform>().localPosition       = new Vector3(120, -mcnt * 100, 0);
                        go.transform.GetChild(1).GetComponent <RectTransform>().localPosition = new Vector3(-600, -mcnt * 100, 0);
                        go.transform.GetChild(2).GetComponent <RectTransform>().localPosition = new Vector3(-600, -mcnt * 100, 0);
                    }
                    go.transform.GetChild(1).GetComponent <Text>().text = data.Split('|')[0];
                    data = data.Split('|')[2];
                }
                else if (data.Contains("&MASTER"))
                {
                    go.transform.GetChild(0).GetComponent <Image>().color = Color.green;
                    go.transform.GetChild(1).GetComponent <Text>().text   = "Master";
                    data = data.Split('|')[1];
                }
                go.transform.GetChild(0).GetComponentInChildren <Text>().text = data;


                chatContainer = tmpchatcontainer;
            }
        }
    }
Ejemplo n.º 19
0
 public void OnLoadGameDataComplete()
 {
     instance.gameDB = XMLManager.GetInstance().gameDB;
 }
Ejemplo n.º 20
0
    IEnumerator LoadLevel()
    {
        //LoadPrefab
        var r = Resources.LoadAsync("Prefabs/Level/Level_" + Global.GetInstance().IndexToString(Global.GetInstance().BattleIndex));

        yield return(r);

        //LevelInit
        var go = Instantiate(r.asset) as GameObject;

        level      = go.transform;
        level.name = r.asset.name;
        var rtsCamera = Camera.main.GetComponent <RTSCamera>();

        rtsCamera.cameraRange = level.Find("CameraRange").gameObject;
        rtsCamera.enabled     = true;

        //VectoryCondition
        vc = level.GetComponent <VectoryCondition>();

        //LoadUnits
        var characterParent  = level.Find("Characters");
        var spawnPointParent = level.Find("SpawnPoints");

        for (int i = 0; i < spawnPointParent.childCount; i++)
        {
            var c         = Resources.Load("Prefabs/Character/" + spawnPointParent.GetChild(i).name.Substring(0, spawnPointParent.GetChild(i).name.IndexOf('_'))) as GameObject;
            var cInstance = Instantiate(c, characterParent);
            cInstance.transform.position = spawnPointParent.GetChild(i).position;
            cInstance.transform.rotation = spawnPointParent.GetChild(i).rotation;
            cInstance.GetComponent <CharacterStatus>().playerNumber = int.Parse(spawnPointParent.GetChild(i).name.Substring(spawnPointParent.GetChild(i).name.IndexOf('_') + 1));
            cInstance.name = spawnPointParent.GetChild(i).name;
        }
        Destroy(spawnPointParent.gameObject);

        //Units
        var unitManager = UnitManager.GetInstance();

        unitManager.InitUnits();
        unitManager.units.ForEach(u => u.GetComponent <Unit>().UnitSelected += UIManager.GetInstance().OnUnitSelected);
        Units = unitManager.units;

        //DialogManager
        DialogManager.GetInstance().enabled = true;

        //Task
        var task = GameObject.Find("Canvas").transform.Find("BattlePrepare").Find("Task");

        task.Find("TaskTitle").GetComponent <Text>().text   = level.Find("TaskTitle").GetComponent <Text>().text;
        task.Find("TaskContent").GetComponent <Text>().text = level.Find("TaskContent").GetComponent <Text>().text;
        Destroy(level.Find("TaskTitle").gameObject);
        Destroy(level.Find("TaskContent").gameObject);

        BattleFieldManager.GetInstance().BuildFloors(level.GetComponent <LevelInfo>().GridX, level.GetComponent <LevelInfo>().GridY);

        yield return(StartCoroutine(XMLManager.LoadAsync <CharacterDataBase>(Application.streamingAssetsPath + "/XML/Core/Level/Level_Battle_" + Global.GetInstance().IndexToString(Global.GetInstance().BattleIndex) + ".xml", result => Global.GetInstance().levelCharacterDB = result)));

        BattleBegin = false;

        //Players
        Players       = new List <Player>();
        playersParent = level.Find("Players");
        for (int i = 0; i < playersParent.childCount; i++)
        {
            var player = playersParent.GetChild(i).GetComponent <Player>();
            if (player != null)
            {
                Players.Add(player);
            }
            else
            {
                Debug.LogError("Invalid object in Players Parent game object");
            }
        }
        NumberOfPlayers     = Players.Count;
        CurrentPlayerNumber = Players.Min(p => p.playerNumber);

        yield return(new WaitForSeconds(0.1f));

        if (Global.GetInstance().levelCharacterDB != null && Global.GetInstance().levelCharacterDB.characterDataList.Count > 0)
        {
            foreach (var characterData in Global.GetInstance().levelCharacterDB.characterDataList)
            {
                Global.GetInstance().characterDB.characterDataList.Add(characterData);
            }
        }
    }
Ejemplo n.º 21
0
 public void OnLoadCharactersComplete()
 {
     instance.characterDB = XMLManager.GetInstance().characterDB;
 }
Ejemplo n.º 22
0
    //sauvegarde des profils

    public static void Save()
    {
        XMLManager.SaveProfiles(profiles);
    }
Ejemplo n.º 23
0
 public void SaveMisions()
 {
     XMLManager.SaveData(misionsPerWorld, XMLManager.MISIONS_FOLDER_NAME, XMLManager.MISIONS_FILE_NAME + ".xml");
 }
Ejemplo n.º 24
0
        private void ExportBodypart_Click(object sender, RoutedEventArgs e)
        {
            string id = InputModname.Text + "_" + InputBodypartName.Text;

            if (string.IsNullOrWhiteSpace(InputModname.Text))
            {
                LabelStatus.Content = "Export failed! Please fill out the Modname.";
                StatusTimer();
                return;
            }
            if (string.IsNullOrWhiteSpace(InputBodypartName.Text))
            {
                LabelStatus.Content = "Export failed! Please fill out the Bodypartname.";
                StatusTimer();
                return;
            }
            string path;


            string bodytype = selectedBodytype.SelectedItem.ToString();
            string color    = selectedColor.SelectedItem.ToString();
            string race     = selectedRace.SelectedItem.ToString();

            if (string.IsNullOrWhiteSpace(parentWindow.modFolderPath))
            {
                path = System.AppDomain.CurrentDomain.BaseDirectory + "Exported\\";
            }
            else
            {
                path = parentWindow.modFolderPath + "\\";
            }



            string bodypart = (selectedBodypart.SelectedItem as ComboBoxItem).Content as string;

            Int32.TryParse(InputCharisma.Text, out int charisma);
            Int32.TryParse(InputConstitution.Text, out int constitution);
            Int32.TryParse(InputDexterity.Text, out int dexterity);
            Int32.TryParse(InputIntelligence.Text, out int intelligence);
            Int32.TryParse(InputStrength.Text, out int strength);
            Int32.TryParse(InputWisdom.Text, out int wisdom);


            path += InputModname.Text + "\\Bodyparts\\" + race + "\\" + bodypart + "s\\";

            Int32.TryParse(InputHealthpoints.Text, out int maxHP);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            Bodypart b = null;

            switch (bodypart)
            {
            case "Head":
                b = new Head(constitution, intelligence, wisdom, charisma, color, bodytype, race);
                break;

            case "Torso":
                b = new Torso(constitution, strength, dexterity, charisma, color, bodytype, race);
                break;

            case "Right Arm":
                b = new RightArm(constitution, strength, dexterity, charisma, color, bodytype, race);
                break;

            case "Left Arm":
                b = new LeftArm(constitution, strength, dexterity, charisma, color, bodytype, race);
                break;

            case "Right Leg":
                b = new RightLeg(constitution, strength, dexterity, charisma, color, bodytype, race);
                break;

            case "Left Leg":
                b = new LeftLeg(constitution, strength, dexterity, charisma, color, bodytype, race);
                break;
            }

            b.id    = id;
            b.MaxHP = maxHP;
            b.Name  = InputBodypartName.Text;

            parentWindow.CopyFile(InputIconPath.Text, path);
            b.Icon = parentWindow.TrimPath(InputIconPath.Text);

            parentWindow.CopyFile(InputIdleDownAnimationPath.Text, path);
            b.idleDownAnimation = parentWindow.TrimPath(InputIdleDownAnimationPath.Text);
            parentWindow.CopyFile(InputIdleUpAnimationPath.Text, path);
            b.idleUpAnimation = parentWindow.TrimPath(InputIdleUpAnimationPath.Text);
            parentWindow.CopyFile(InputIdleRightAnimationPath.Text, path);
            b.idleRightAnimation = parentWindow.TrimPath(InputIdleRightAnimationPath.Text);
            parentWindow.CopyFile(InputIdleLeftAnimationPath.Text, path);
            b.idleLeftAnimation = parentWindow.TrimPath(InputIdleLeftAnimationPath.Text);

            parentWindow.CopyFile(InputWalkDownAnimationPath.Text, path);
            b.walkDownAnimation = parentWindow.TrimPath(InputWalkDownAnimationPath.Text);
            parentWindow.CopyFile(InputWalkUpAnimationPath.Text, path);
            b.walkUpAnimation = parentWindow.TrimPath(InputWalkUpAnimationPath.Text);
            parentWindow.CopyFile(InputWalkRightAnimationPath.Text, path);
            b.walkRightAnimation = parentWindow.TrimPath(InputWalkRightAnimationPath.Text);
            parentWindow.CopyFile(InputWalkLeftAnimationPath.Text, path);
            b.walkLeftAnimation = parentWindow.TrimPath(InputWalkLeftAnimationPath.Text);

            parentWindow.CopyFile(InputAttackDownAnimationPath.Text, path);
            b.attackDownAnimation = parentWindow.TrimPath(InputAttackDownAnimationPath.Text);
            parentWindow.CopyFile(InputAttackUpAnimationPath.Text, path);
            b.attackUpAnimation = parentWindow.TrimPath(InputAttackUpAnimationPath.Text);
            parentWindow.CopyFile(InputAttackRightAnimationPath.Text, path);
            b.attackRightAnimation = parentWindow.TrimPath(InputAttackRightAnimationPath.Text);
            parentWindow.CopyFile(InputAttackLeftAnimationPath.Text, path);
            b.attackLeftAnimation = parentWindow.TrimPath(InputAttackLeftAnimationPath.Text);

            parentWindow.CopyFile(InputMagicDownAnimationPath.Text, path);
            b.magicDownAnimation = parentWindow.TrimPath(InputMagicDownAnimationPath.Text);
            parentWindow.CopyFile(InputMagicUpAnimationPath.Text, path);
            b.magicUpAnimation = parentWindow.TrimPath(InputMagicUpAnimationPath.Text);
            parentWindow.CopyFile(InputMagicRightAnimationPath.Text, path);
            b.magicRightAnimation = parentWindow.TrimPath(InputMagicRightAnimationPath.Text);
            parentWindow.CopyFile(InputMagicLeftAnimationPath.Text, path);
            b.magicLeftAnimation = parentWindow.TrimPath(InputMagicLeftAnimationPath.Text);



            switch (bodypart)
            {
            case "Head":
                Head h = b as Head;
                h.skillIDs = new string[3] {
                    InputSkill1.Text, InputSkill2.Text, InputSkill3.Text
                };
                XMLManager.Save(path + id, h);
                break;

            case "Torso":
                Torso t = b as Torso;
                t.skillIDs = new string[2] {
                    InputSkill1.Text, InputSkill2.Text
                };
                XMLManager.Save(path + id, t);
                break;

            case "Right Arm":
                RightArm ra = b as RightArm;
                ra.skillIDs = new string[2] {
                    InputSkill1.Text, InputSkill2.Text
                };
                XMLManager.Save(path + id, ra);
                break;

            case "Left Arm":
                LeftArm la = b as LeftArm;
                la.skillIDs = new string[2] {
                    InputSkill1.Text, InputSkill2.Text
                };
                XMLManager.Save(path + id, la);
                break;

            case "Right Leg":
                RightLeg rl = b as RightLeg;
                rl.skillIDs = new string[1] {
                    InputSkill1.Text
                };
                XMLManager.Save(path + id, rl);
                break;

            case "Left Leg":
                LeftLeg ll = b as LeftLeg;
                ll.skillIDs = new string[1] {
                    InputSkill1.Text
                };
                XMLManager.Save(path + id, ll);
                break;
            }

            LabelStatus.Content = "Export successful.";
            StatusTimer();
        }
Ejemplo n.º 25
0
        private static void doShowSplash()
        {
            try {
                if (splash == null)
                {
                    splash = new Splash();
                }

                splash.lVersion.Text = "v" + Application.ProductVersion;
                String completedSyncs = XMLManager.ImportElement("CompletedSyncs", Settings.ConfigFile) ?? "0";
                if (completedSyncs == "0")
                {
                    splash.lSyncCount.Visible = false;
                }
                else
                {
                    splash.lSyncCount.Text = splash.lSyncCount.Text.Replace("{syncs}", String.Format("{0:n0}", completedSyncs));
                    splash.lSyncCount.Left = (splash.panel1.Width - (splash.lSyncCount.Width)) / 2;
                }
                //Load settings directly from XML
                donor = (XMLManager.ImportElement("Donor", Settings.ConfigFile) ?? "false") == "true";

                String subscribedDate = XMLManager.ImportElement("Subscribed", Settings.ConfigFile);
                if (!string.IsNullOrEmpty(subscribedDate))
                {
                    subscribed = DateTime.Parse(subscribedDate);
                }
                else
                {
                    subscribed = GoogleOgcs.Authenticator.SubscribedNever;
                }

                Boolean hideSplash = (XMLManager.ImportElement("HideSplashScreen", Settings.ConfigFile) ?? "false") == "true";
                initialised = true;

                splash.cbHideSplash.Checked = hideSplash;
                if (subscribed == GoogleOgcs.Authenticator.SubscribedNever && !donor)
                {
                    ToolTips = new ToolTip {
                        AutoPopDelay = 10000,
                        InitialDelay = 500,
                        ReshowDelay  = 200,
                        ShowAlways   = true
                    };

                    ToolTips.SetToolTip(splash.cbHideSplash, "Donate £10 or more to enable this feature.");
                }
                else if (hideSplash)
                {
                    log.Debug("Suppressing splash screen.");
                    return;
                }
                splash.TopLevel = true;
                splash.TopMost  = true;
                log.Debug("Showing splash screen.");
                Application.Run(splash);
                log.Debug("Disposed of splash screen.");
                splashThread.Abort();
            } finally {
                initialised = true;
                BeenAndGone = true;
            }
        }
Ejemplo n.º 26
0
        /// <summary>Deserialize the theme contents.</summary>
        /// <param name="themeDocument">The theme document.</param>
        /// <returns>The <see cref="Theme" />.</returns>
        public static Theme Deserialize(XContainer themeDocument)
        {
            const string Header      = @"VisualPlus-Theme/";
            const string Information = Header + @"Information/";
            const string StyleTable  = Header + @"StyleTable/";
            const string Shared      = StyleTable + @"Shared/";
            const string Toolkit     = StyleTable + @"Toolkit/";

            ThemeInformation themeInformation = new ThemeInformation();
            ColorPalette     colorPalette     = new ColorPalette();

            // TODO: Method body is too complex to properly analyze, consider decomposing it.
            try
            {
                themeInformation.Author = XMLManager.ReadElement(themeDocument, Information + "Author");
                themeInformation.Name   = XMLManager.ReadElement(themeDocument, Information + "Name");

                colorPalette.BorderNormal = XMLManager.ReadElement(themeDocument, Shared + "Border/Normal").ToColor();
                colorPalette.BorderHover  = XMLManager.ReadElement(themeDocument, Shared + "Border/Hover").ToColor();

                colorPalette.TextDisabled     = XMLManager.ReadElement(themeDocument, Shared + "Text/Disabled").ToColor();
                colorPalette.TextEnabled      = XMLManager.ReadElement(themeDocument, Shared + "Text/Enabled").ToColor();
                colorPalette.TextHover        = XMLManager.ReadElement(themeDocument, Shared + "Text/Hover").ToColor();
                colorPalette.TextPressed      = XMLManager.ReadElement(themeDocument, Shared + "Text/Pressed").ToColor();
                colorPalette.Selected         = XMLManager.ReadElement(themeDocument, Shared + "Text/Selected").ToColor();
                colorPalette.SubscriptColor   = XMLManager.ReadElement(themeDocument, Shared + "Text/Subscript").ToColor();
                colorPalette.SuperscriptColor = XMLManager.ReadElement(themeDocument, Shared + "Text/Superscript").ToColor();
                colorPalette.TextLight        = XMLManager.ReadElement(themeDocument, Shared + "Text/TextLight").ToColor();

                // colorPalette.Font = FontManager.ResolveFontFamily(themeDocument.GetValue(Shared + "Font/FontFamily"));
                colorPalette.Item          = XMLManager.ReadElement(themeDocument, Shared + "ListItem/Normal").ToColor();
                colorPalette.ItemHover     = XMLManager.ReadElement(themeDocument, Shared + "ListItem/Hover").ToColor();
                colorPalette.ItemSelected  = XMLManager.ReadElement(themeDocument, Shared + "ListItem/Selected").ToColor();
                colorPalette.ItemAlternate = XMLManager.ReadElement(themeDocument, Shared + "ListItem/Alternate").ToColor();

                colorPalette.ColumnHeader = XMLManager.ReadElement(themeDocument, Shared + "ColumnHeader/Header").ToColor();
                colorPalette.ColumnText   = XMLManager.ReadElement(themeDocument, Shared + "ColumnHeader/Text").ToColor();

                colorPalette.ControlEnabled  = XMLManager.ReadElement(themeDocument, Shared + "Control/Enabled").ToColor();
                colorPalette.ControlDisabled = XMLManager.ReadElement(themeDocument, Shared + "Control/Disabled").ToColor();

                colorPalette.BackCircle = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRadialProgress/BackCircle").ToColor();
                colorPalette.ForeCircle = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRadialProgress/ForeCircle").ToColor();

                colorPalette.ProgressBackground = XMLManager.ReadElement(themeDocument, Shared + "ProgressBar/Background").ToColor();
                colorPalette.Progress           = XMLManager.ReadElement(themeDocument, Shared + "ProgressBar/Working").ToColor();
                colorPalette.ProgressDisabled   = XMLManager.ReadElement(themeDocument, Shared + "ProgressBar/Disabled").ToColor();

                colorPalette.HatchBackColor = XMLManager.ReadElement(themeDocument, Shared + "Hatch/BackColor").ToColor();
                colorPalette.HatchForeColor = XMLManager.ReadElement(themeDocument, Shared + "Hatch/ForeColor").ToColor();

                colorPalette.ElementDisabled = XMLManager.ReadElement(themeDocument, Shared + "Element/Disabled").ToColor();
                colorPalette.ElementEnabled  = XMLManager.ReadElement(themeDocument, Shared + "Element/Enabled").ToColor();

                colorPalette.WatermarkActive   = XMLManager.ReadElement(themeDocument, Shared + "Watermark/Active").ToColor();
                colorPalette.WatermarkInactive = XMLManager.ReadElement(themeDocument, Shared + "Watermark/Inactive").ToColor();

                colorPalette.TabPageEnabled  = XMLManager.ReadElement(themeDocument, Shared + "TabPage/Enabled").ToColor();
                colorPalette.TabPageDisabled = XMLManager.ReadElement(themeDocument, Shared + "TabPage/Disabled").ToColor();
                colorPalette.TabPageHover    = XMLManager.ReadElement(themeDocument, Shared + "TabPage/Hover").ToColor();
                colorPalette.TabPageSelected = XMLManager.ReadElement(themeDocument, Shared + "TabPage/Selected").ToColor();

                colorPalette.Enabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualButton/Enabled").ToColor();
                colorPalette.Disabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualButton/Disabled").ToColor();
                colorPalette.Hover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualButton/Hover").ToColor();
                colorPalette.Pressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualButton/Pressed").ToColor();

                colorPalette.VisualComboBoxDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualComboBox/Disabled").ToColor();
                colorPalette.VisualComboBoxEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualComboBox/Enabled").ToColor();

                colorPalette.FormBackground = XMLManager.ReadElement(themeDocument, Toolkit + "VisualForm/Background").ToColor();
                colorPalette.FormWindowBar  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualForm/WindowBar").ToColor();

                colorPalette.HelpButtonBackDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/BackColorState/Disabled").ToColor();
                colorPalette.HelpButtonBackEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/BackColorState/Enabled").ToColor();
                colorPalette.HelpButtonBackHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/BackColorState/Hover").ToColor();
                colorPalette.HelpButtonBackPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/BackColorState/Pressed").ToColor();

                colorPalette.HelpButtonForeDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/ForeColorState/Disabled").ToColor();
                colorPalette.HelpButtonForeEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/ForeColorState/Enabled").ToColor();
                colorPalette.HelpButtonForeHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/ForeColorState/Hover").ToColor();
                colorPalette.HelpButtonForePressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/HelpButton/ForeColorState/Pressed").ToColor();

                colorPalette.MinimizeButtonBackDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/BackColorState/Disabled").ToColor();
                colorPalette.MinimizeButtonBackEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/BackColorState/Enabled").ToColor();
                colorPalette.MinimizeButtonBackHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/BackColorState/Hover").ToColor();
                colorPalette.MinimizeButtonBackPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/BackColorState/Pressed").ToColor();

                colorPalette.MinimizeButtonForeDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/ForeColorState/Disabled").ToColor();
                colorPalette.MinimizeButtonForeEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/ForeColorState/Enabled").ToColor();
                colorPalette.MinimizeButtonForeHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/ForeColorState/Hover").ToColor();
                colorPalette.MinimizeButtonForePressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MinimizeButton/ForeColorState/Pressed").ToColor();

                colorPalette.MaximizeButtonBackDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/BackColorState/Disabled").ToColor();
                colorPalette.MaximizeButtonBackEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/BackColorState/Enabled").ToColor();
                colorPalette.MaximizeButtonBackHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/BackColorState/Hover").ToColor();
                colorPalette.MaximizeButtonBackPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/BackColorState/Pressed").ToColor();

                colorPalette.MaximizeButtonForeDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/ForeColorState/Disabled").ToColor();
                colorPalette.MaximizeButtonForeEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/ForeColorState/Enabled").ToColor();
                colorPalette.MaximizeButtonForeHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/ForeColorState/Hover").ToColor();
                colorPalette.MaximizeButtonForePressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/MaximizeButton/ForeColorState/Pressed").ToColor();

                colorPalette.CloseButtonBackDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/BackColorState/Disabled").ToColor();
                colorPalette.CloseButtonBackEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/BackColorState/Enabled").ToColor();
                colorPalette.CloseButtonBackHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/BackColorState/Hover").ToColor();
                colorPalette.CloseButtonBackPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/BackColorState/Pressed").ToColor();

                colorPalette.CloseButtonForeDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/ForeColorState/Disabled").ToColor();
                colorPalette.CloseButtonForeEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/ForeColorState/Enabled").ToColor();
                colorPalette.CloseButtonForeHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/ForeColorState/Hover").ToColor();
                colorPalette.CloseButtonForePressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualControlBox/CloseButton/ForeColorState/Pressed").ToColor();

                colorPalette.ScrollBarDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Bar/Disabled").ToColor();
                colorPalette.ScrollBarEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Bar/Enabled").ToColor();

                colorPalette.ScrollThumbDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Thumb/Disabled").ToColor();
                colorPalette.ScrollThumbEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Thumb/Enabled").ToColor();
                colorPalette.ScrollThumbHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Thumb/Hover").ToColor();
                colorPalette.ScrollThumbPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Thumb/Pressed").ToColor();

                colorPalette.ScrollButtonDisabled = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Button/Disabled").ToColor();
                colorPalette.ScrollButtonEnabled  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Button/Enabled").ToColor();
                colorPalette.ScrollButtonHover    = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Button/Hover").ToColor();
                colorPalette.ScrollButtonPressed  = XMLManager.ReadElement(themeDocument, Toolkit + "VisualScrollBar/Button/Pressed").ToColor();

                colorPalette.Star           = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRating/Star").ToColor();
                colorPalette.StarBorder     = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRating/Border").ToColor();
                colorPalette.StarDull       = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRating/Dull").ToColor();
                colorPalette.StarDullBorder = XMLManager.ReadElement(themeDocument, Toolkit + "VisualRating/DullBorder").ToColor();

                colorPalette.VisualSeparatorLine   = XMLManager.ReadElement(themeDocument, Toolkit + "VisualSeparator/Line").ToColor();
                colorPalette.VisualSeparatorShadow = XMLManager.ReadElement(themeDocument, Toolkit + "VisualSeparator/Shadow").ToColor();
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            Theme theme = new Theme(themeInformation, colorPalette);

            return(theme);
        }
Ejemplo n.º 27
0
 // Start is called before the first frame update
 void Start()
 {
     xMLManager = new XMLManager();
     Load();
 }
Ejemplo n.º 28
0
 void Awake()
 {
     xmlToSave = new XMLManager(testInt, testPos.position);
 }
Ejemplo n.º 29
0
 void Awake()
 {
     ins = this;
 }
Ejemplo n.º 30
0
 public void SaveData()
 {
     xmlSaved          = WriteData(xmlToSave);
     xmlSaved.number   = testInt;
     xmlSaved.position = testPos.position;
 }
Ejemplo n.º 31
0
        private bool ValidateXML(string xmlPath, Configuracion conf)
        {
            XMLManager xml = new XMLManager();

            return(xml.Validate(xmlPath, conf.XsdPath, conf.NameSpace));
        }
    // Start is called before the first frame update
    private void Start()
    {
        // check if settings.json exist
        if (File.Exists(Application.dataPath + "/settings.xml"))
        {
            //string json = File.ReadAllText(Application.dataPath + "/settings.json");

            //settings = JsonUtility.FromJson<Settings>(json);

            XMLManager.LoadData(out settings, Application.dataPath + "/settings.xml");

            Debug.Log("settings file loaded");
        }
        else
        {
            settings.loadNetworkAtStart = false;
            settings.saveBestNetwork    = true;

            //string json = JsonUtility.ToJson(settings);
            //File.WriteAllText(Application.dataPath + "/settings.json", json);

            XMLManager.SaveData(settings, Application.dataPath + "/settings.xml");

            Debug.Log("settings file created");
        }

        if (populationSize % 2 != 0)
        {
            populationSize++;
        }

        timeElapsed = 0f;
        for (int i = 0; i < populationSize; i++)
        {
            cars.Add(Instantiate(carPrefab, transform.position, transform.rotation, transform));

            float value = (float)i / (float)populationSize;
            //Vector3 color;

            float H = value;

            //cars[i].GetComponent<CarController>().SetLayers(layers);
            //cars[i].GetComponent<CarController>().SetGoal(goal);
            cars[i].GetComponent <CarController>().SetStart(transform);
            cars[i].GetComponent <CarController>().SetWaypoints(waypoints);

            cars[i].GetComponent <CarController>().InitNetwork();

            if (settings.loadNetworkAtStart)
            {
                if (i != 0)
                {
                    cars[i].GetComponent <CarController>().Mutate(cars[0]);
                }
                else
                {
                    if (File.Exists(Application.dataPath + "/network.xml"))
                    {
                        cars[i].GetComponent <CarController>().LoadData(Application.dataPath + "/network.xml");
                    }
                }
            }

            cars[i].GetComponent <CarController>().SetHue(H);
        }

        mainCamera.GetComponent <CameraController>().SetCamerTarget(cars[0]);

        //currentSpeeds = new List<float>();
    }
Ejemplo n.º 33
0
        private string TransformXml(string xmlPath, string xsltPath)
        {
            XMLManager xml = new XMLManager();

            return(xml.XMLToLayout(xmlPath, xsltPath));
        }
Ejemplo n.º 34
0
 private void Awake()
 {
     ins = this;
 }
Ejemplo n.º 35
0
    public IEnumerator LoadPreset()
    {
        yield return(StartCoroutine(XMLManager.LoadAsync <CharacterDataBase>(Application.streamingAssetsPath + "/XML/Preset/characterData.xml", result => Global.GetInstance().characterDB = result)));

        yield return(StartCoroutine(XMLManager.LoadAsync <PlayerDataBase>(Application.streamingAssetsPath + "/XML/Preset/playerData.xml", result => Global.GetInstance().playerDB = result)));
    }