public void LoadSave3() //Loads Save Slot 3 { StaticLoad.saveSlot = 3; StaticLoad.loading = true; player = XMLOp.Deserialize <Player>("Save3.xml"); SceneManager.LoadScene(player.scene); }
private void Load() { var nodesDeserialized = XMLOp.Deserialize <List <Node> >("Assets/Resources/nodes.xml"); var connectionsDeserialized = XMLOp.Deserialize <List <Connection> >("Assets/Resources/connections.xml"); nodes = new List <Node>(); connections = new List <Connection>(); foreach (var nodeDeserialized in nodesDeserialized) { nodes.Add(new Node( nodeDeserialized.rect.position, nodeDeserialized.rect.width, nodeDeserialized.rect.height, nodeStyle, selectedNodeStyle, inPointStyle, outPointStyle, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode, nodeDeserialized.inPoint.id, nodeDeserialized.outPoint.id ) ); } foreach (var connectionDeserialized in connectionsDeserialized) { var inPoint = nodes.First(n => n.inPoint.id == connectionDeserialized.inPoint.id).inPoint; var outPoint = nodes.First(n => n.outPoint.id == connectionDeserialized.outPoint.id).outPoint; connections.Add(new Connection(inPoint, outPoint, OnClickRemoveConnection)); } }
//done init public void fetch() { Char a = XMLOp.Deserialize <Char>(characterFile); Ourtexts = a.texts; Ourname = a.name; }
public static GenAreaMetaData Read(IntVector3 origin) { if (!File.Exists(FilePath(origin))) { return(default(GenAreaMetaData)); } return(XMLOp.Deserialize <GenAreaMetaData>(FilePath(origin))); }
// Use this for initialization void Start() { pseudoDialogue = XMLOp.Deserialize <Dialogue>("Assets/XML/Dialogue Pseudo.xml"); // Testing //XMLOp.Serialize(pseudoDialogue, "Assets/XML/dialogue.xml"); //Debug.Log(pseudoDialogue.conversation[0].dialogueChains[1].dialogueOptions[0].textOptions[0].dialogueText[0].text); //Debug.Log(pseudoDialogue.conversation[0].dialogueChains[1].dialogueOptions[1].textOptions[0].dialogueText[0].text); }
bool HasBeenNeighborProcessed(IntVector3 chunkPos) { if (File.Exists(SerializedChunk.GetMetaDataFullPath(chunkPos))) { Chunk.MetaData meta = XMLOp.Deserialize <Chunk.MetaData>(SerializedChunk.GetMetaDataFullPath(chunkPos)); return(meta.HasBeenNeighborProcessed); } return(false); }
private void Start() { string manifest = FindFile(Application.dataPath, "SceneManifest.xml", true); if (manifest != "") { sceneManifest = XMLOp.Deserialize <List <SceneInfo> >(manifest); } }
// Update is called once per frame void Update() { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit) && hit.collider.tag == "gridElement") { this.transform.position = hit.collider.transform.position; lastHit = hit.collider.gameObject.GetComponent <gridElement>(); this.rectTransform.sizeDelta = new Vector2(1.0f, lastHit.GetElementHeight()); if (Input.GetMouseButtonDown(1)) { SetCurserButton(0); } } // reset when press 5 //read a file, instantiate a constructor by width height. then read an array to enable and disable gridElement. if (Input.GetKeyDown("5")) { constructor.instance.freeMemory(); constructor.instance.initialize(10, 2); } //save file if (Input.GetKeyDown("1")) { XMLOp.Serialize(constructor.instance.info, "constructorInfo.xml"); } if (Input.GetKeyDown("2")) { constructorInfo outInfo = new constructorInfo(); outInfo = XMLOp.Deserialize <constructorInfo>("constructorInfo.xml"); constructor.instance.info.width = outInfo.width; constructor.instance.info.height = outInfo.height; constructor.instance.freeMemory(); constructor.instance.initialize(outInfo.width, outInfo.height); for (int i = 0; i < outInfo.width * outInfo.width * outInfo.height; i++) { if (outInfo.gridElementStatus[i] == 0) { Debug.Log(i); constructor.instance.info.gridElementStatus[i] = 0; constructor.instance.gridElements[i].SetDisable(); } else { constructor.instance.info.gridElementStatus[i] = 1; constructor.instance.gridElements[i].SetEnable(); } } } }
public void xml() { XMLRobot robo = XMLOp.Deserialize <XMLRobot>("imported.xml"); if (asama == 0) { m_TurnInputValue = robo.rotationGrab1; } if (asama == 1) { m_TurnInputValue = robo.rotationDrop1; } }
private void Load() { var nodesDeserialized = XMLOp.Deserialize <List <ENodeBase> >("Assets/Resources/nodes.xml"); var connectionsDeserialized = XMLOp.Deserialize <List <Connection> >("Assets/Resources/connections.xml"); Nodes = new List <ENodeBase>(); connections = new List <Connection>(); foreach (var node in nodesDeserialized) { if (node is ENodeDialogueOptions) { Nodes.Add(new ENodeDialogueOptions( node.rect.position, inPointStyle, outPointStyle, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode, RemoveOptionConnections, node.inPoint.id, node.outPoint.id, ((ENodeDialogueOptions)node).outPoint01.id, ((ENodeDialogueOptions)node).outPoint02.id ) ); } else if (node is ENodeDialogueNormal) { Nodes.Add(new ENodeDialogueNormal( node.rect.position, inPointStyle, outPointStyle, OnClickInPoint, OnClickOutPoint, OnClickRemoveNode, node.inPoint.id, node.outPoint.id ) ); } } foreach (var connectionDeserialized in connectionsDeserialized) { var inPoint = Nodes.First(n => n.inPoint.id == connectionDeserialized.inPoint.id).inPoint; var outPoint = Nodes.First(n => n.outPoint.id == connectionDeserialized.outPoint.id).outPoint; connections.Add(new Connection(inPoint, outPoint, OnClickRemoveConnection)); } }
// Use this for initialization void Start() { pseudoDialogue = XMLOp.Deserialize <Dialogue>("Assets/XML/Dialogue Pseudo.xml"); // Deserialization testing //TestDeserialization(); // Assign dialogues to their respective characters AssignDialogues(); var progressButton = debugProgressDay.GetComponent <Button>(); progressButton.onClick.AddListener(DialogueController.Instance.ProgressDay); }
public static void SetupKeybind() { currKeybind = XMLOp.Deserialize <KeybindClass[]>(Application.dataPath + "/Resources/" + "Keybind_Save.xml"); keyBinds.Clear(); for (int i = 0; i < currKeybind.Length; i++) { if (currKeybind[i].controlName == "") { continue; } keyBinds.Add(currKeybind[i].controlName, currKeybind[i].keyCodeValue); } iskeybindAssign = true; }
//loads the song data and instantiates the song score and is ready for start to be pressed public void Load() { if (configPath == "") { configPath = UnityEditor.EditorUtility.OpenFilePanel("Select a Song config", "", ""); } Config config = XMLOp.Deserialize <Config>(configPath); SongData songData = scoreDB.songScores.Find(x => x.songTitle == config.songTitle); songClip = (AudioClip)Resources.Load("Songs/Music/" + config.songTitle, typeof(AudioClip)); song.clip = songClip; songName = songData.songTitle; songNameInput.text = songData.songTitle; GameObject go = Instantiate(songData.songScoreObject, new Vector3(0f, 2.5f, 0f), Quaternion.identity); songScore = go; songScore.SetActive(false); }
// Start is called before the first frame update void Start() { saveSlot = StaticLoad.saveSlot; if (StaticLoad.loading == true) { if (System.IO.File.Exists("Save" + saveSlot + ".xml")) { player = XMLOp.Deserialize <Player>("Save" + saveSlot + ".xml"); } else { player.name = "Jonas"; // player.hp = 100; // player.atk = 5; // player.def = 5; // player.accuracy = 1.0f; // player.efficiency = 1.0f; // Set these values to the new character defaults player.level = 1; // Vector3 playerPos = new Vector3(0f, 0f, 0f); // player.posx = playerPos.x; // player.posy = playerPos.y; // player.posz = playerPos.z; // player.scene = SceneManager.GetActiveScene().name; // } } else { player.name = "Jonas"; // player.hp = 100; // player.atk = 5; // player.def = 5; // player.accuracy = 1.0f; // player.efficiency = 1.0f; // Set these values to the new character defaults player.level = 1; // Vector3 playerPos = new Vector3(0f, 0f, 0f); // player.posx = playerPos.x; // player.posy = playerPos.y; // player.posz = playerPos.z; // player.scene = SceneManager.GetActiveScene().name; // } }
void Start() { if (System.IO.File.Exists("player.xml")) { Debug.Log("File Exists"); player = XMLOp.Deserialize <Player>("player.xml"); userName.text = player.userName; race.text = player.race; characterClass.value = player.characterClass; level.text = player.level.ToString(); health.value = player.health; } else { NPF.SetActive(true); Debug.Log("File doesn't exist"); userName.text = player.userName; race.text = player.race; characterClass.value = player.characterClass; level.text = player.level.ToString(); health.value = player.health; } }
private void Load() { var nodesDeserialized = XMLOp.Deserialize <List <DialogNode> >("Assets/Resources/nodes.xml"); var connectionsDeserialized = XMLOp.Deserialize <List <Connections> >("Assets/Resources/connections.xml"); nodes = new List <DialogNode>(); connections = new List <Connections>(); foreach (var nodeDeserialized in nodesDeserialized) { /* * nodes.Add(new DialogNode( * nodeDeserialized.rect.position, * nodeDeserialized.rect.width, * nodeDeserialized.rect.height, * nodeStyle, * selectedNodeStyle, * inPointStyle, * outPointStyle, * OnClickInPoint, * OnClickOutPoint, * nodeDeserialized.inPoint.id, * nodeDeserialized.outPoint.id, * nodeDeserialized.isRoot, * OnClickRemoveNode, * nodeDeserialized.nodeID * ) * ); */ } foreach (var connectionDeserialized in connectionsDeserialized) { var inPoint = nodes.First(n => n.inPoint.id == connectionDeserialized.inPoint.id).inPoint; var outPoint = nodes.First(n => n.outPoint.id == connectionDeserialized.outPoint.id).outPoint; connections.Add(new Connections(inPoint, outPoint, OnClickRemoveConnection)); } }
public void Load() { if (System.IO.File.Exists("player.xml")) { player = XMLOp.Deserialize <Player>("player.xml"); /// added by Brian Debug.Log(player._XPos + " " + player._YPos + " " + player._ZPos); Debug.Log(playerObj.transform.position); cc.enabled = false; playerObj.transform.position = new Vector3(player._XPos, player._YPos, player._ZPos); cc.enabled = true; /// } /* else * { * player._health = health.currentHealth; * player._oil = lantern.currentOil; * player._XPos = playerObj.transform.position.x; * player._YPos = playerObj.transform.position.y; * player._ZPos = playerObj.transform.position.z; * XMLOp.Serialize(player, "player.xml"); // for save button also * }*/ }
private void Start() { Hero hero = XMLOp.Deserialize <Hero>("hero.xml"); Debug.Log(hero.name); }