public void Init() { if (sessionData == null || sessionData.Length == 0) { sessionData = PersistantData.Load(); } }
// Update is called once per frame void Update() { if (pd == null) { pd = FindObjectOfType <PersistantData>(); } }
void save() { string path = Application.dataPath + "/Resources/Data/Enemies"; var data = PersistantData.SerializeToBytes(_teamList); PersistantData.SaveBytesToFile(Application.dataPath + "/Resources/Data/Enemies/", "Teams.bytes", data); }
private bool CheckLegacyPrinterHistory() { var path = Path.Combine(Paths.SpoolerStorage, "printerhistory.db2"); try { var textReader = (TextReader) new StreamReader(path); string str; do { str = textReader.ReadLine(); if (string.IsNullOrEmpty(str)) { return(false); } }while (!str.Contains("<Parameter Name=\"" + MyPrinterInfo.MySerialNumber + "\"")); PersistantDetails = new PersistantData { GantryClipsRemoved = str.Contains("gantry_clips_removed=\"true\"") }; SavePersistantData(); return(true); } catch (Exception ex) { } return(false); }
// Use this for initialization void Start() { data = PersistantData.instance; PokemonSelectionCanvas.gameObject.SetActive(false); foreach (KeyValuePair <DataPkm.GameVersion, string> dataPair in DataPkm.GameVersionStringKey) { if (dataPair.Key != DataPkm.GameVersion.UNKNOW) { GameVersionDD.options.Add(new Dropdown.OptionData() { text = dataPair.Value }); TmpValueGame[dataPair.Value] = dataPair.Key; } } if (data.data.HuntActive == -1) { GameVersionDD.value = (int)DefaultGame; GameVersionDD.captionText.text = DataPkm.GameVersionStringKey[DefaultGame]; } else { GameVersionDD.value = (int)data.data.GetActiveHunt().Game; GameVersionDD.captionText.text = DataPkm.GameVersionStringKey[data.data.GetActiveHunt().Game]; } GenerateMethod(true); }
// Use this for initialization void Start() { ResultCount = GetComponent <Text>(); if (!ResultCount) { ResultCount = GetComponentInChildren <Text>(); } if (!ResultCount) { Debug.LogError("There is no TextComponent for CounterScript"); } Background = GameObject.Find("DarkBackground").GetComponent <Image>(); InputFieldText = GameObject.Find("InputField").gameObject; Edit = InputFieldText.GetComponent <InputField>(); DeleteCanvas = GameObject.Find("DeleteCanvas").gameObject; data = PersistantData.instance; if (data.data.GetActiveHunt() == null) { Debug.LogError("There is no active Hunt"); } Background.gameObject.SetActive(false); InputFieldText.SetActive(false); DeleteCanvas.SetActive(false); Count = data.data.GetActiveHunt().totalCount; }
// Use this for initialization void Start() { data = PersistantData.instance; itemList = new List <Pokemon>(); buttonObjectPool = GetComponent <ButtonPool>(); RefreshDisplay(); }
// Use this for initialization void Start() { data = PersistantData.instance; itemList = data.data.Hunts; PersistantData.instance.data.HuntActive = -1; RefreshDisplay(); }
private void Start() { PersistantData pdata = GameObject.Find("PersistentData").GetComponent <PersistantData>(); attributeInfoScripts = new List <DataInfoAttributeHolderObject>(); AddAttributes(pdata.DatasetNames.ToArray()); }
void Start() { if (data == null) { data = FindObjectOfType <PersistantData>(); } YellowSector.SetActive(data.unlockYellow); }
void Start() { //check wether the player has a custom location to be loaded in the new scene if (PersistantData.HasPositionInScene()) { _playerObject.transform.position = PersistantData.GetPlayerPositionInScene(); } }
public void SaveWorld() { if (ItemDatabase.Instance.HasItems()) { PersistantData.SaveItemDatabase(); } PersistantData.SaveSceneData(SceneManager.GetActiveScene().name, _playerObject.transform.position, FindObjectsOfType <Shop>()); PersistantData.SavePartyData(_partyInventory, _playerManager, _clanManager); }
private void Awake() { FilePanel = GameObject.Find("ListComponents"); FileOptionsPanel = GameObject.Find("OptionsPanel"); Datapersistent = GameObject.Find("PersistentData").GetComponent <PersistantData>(); TypesListPanel = GameObject.Find("TypesListPanel"); MainMenu = GameObject.Find("MainMenuPanel"); FileExplorerCanvas = GameObject.Find("FileExplorerCanvas"); }
void LoadEnemy(string name) { string path = Application.dataPath + "/Resources/Data/Enemies/"; if (System.IO.File.Exists(path + name + ".bytes")) { var data = PersistantData.ReadBytesFromFile(path, name + ".bytes"); _enemy = PersistantData.DeserializeToType <Character>(data); } }
void load() { string path = Application.dataPath + "/Resources/Data/Enemies/"; if (System.IO.File.Exists(path + "Teams.bytes")) { var data = PersistantData.ReadBytesFromFile(path, "Teams.bytes"); _teamList = PersistantData.DeserializeToType <List <EnemyList> >(data); } }
public virtual void UpdateFact() { PersistantData data = PersistantData.instance; float marbleAmount = data.GetMostPickedAnswerPercentage(); string[] split = textToUpdate.text.Split('%'); string s = (marbleAmount * 100).ToString("0.00"); textToUpdate.text = split[0] + s + "%" + split[1]; }
public override void OnInspectorGUI() { DrawDefaultInspector(); WorldManager myScript = (WorldManager)target; if (GUILayout.Button("Clear Saves")) { PersistantData.ClearSaves(); } }
void Awake() { if (m_instance == null) { DontDestroyOnLoad(this); m_instance = this; } else { Destroy(gameObject); } }
public void LoadWorld() { //load item database if (!ItemDatabase.Instance.HasItems()) { PersistantData.LoadItemDatabase(); } //Attempt to load Scene PersistantData.LoadSceneData(SceneManager.GetActiveScene().name, _playerObject.transform, FindObjectsOfType <Shop>()); //load party PersistantData.LoadPartyData(_partyInventory, _playerManager, _clanManager); }
private void levelUp() { GameData d = PersistantData.instance.data; if (d.Story == 0) { d.Story = 1; gameObjectOnScene = GameObject.Find("PersistantData"); persistantData = gameObjectOnScene.GetComponent <PersistantData>(); persistantData.Save(); } }
private void Awake() { DontDestroyOnLoad(this.gameObject); if (currInstance == null) { currInstance = this; } else { Destroy(gameObject); } }
private void Awake() { brando = true; if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
void Awake() { if (Instance) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
private void Awake() { TextAsset assest = Resources.Load("Data/Enemies/Teams") as TextAsset; if (assest != null) { EnemyGroups = PersistantData.DeserializeToType <List <EnemyList> >(assest); } else { Debug.LogError("Failed to load enemy teams"); } }
private void OnEnable() { if (_Instance == null) { _Instance = this; DontDestroyOnLoad(this); } else { Debug.Log("Instance Already Exists, Destroying This..."); Destroy(this.gameObject); } }
private void Awake() { DontDestroyOnLoad(gameObject); numberOfDeaths = -1; if (instance == null) { instance = this; } else if (instance != this) { Destroy(this.gameObject); } }
// Use this for initialization void Start() { if (m_instance == null) { m_instance = this; } else { Destroy(this); } DontDestroyOnLoad(this); }
public void Continue() { var ClanMembers = PersistantData.GetSavedClanData(); if (ClanMembers.Count > 0) { SceneManager.LoadScene(BaracksScene); } else { SceneManager.LoadScene(MainMenuScene); } }
private void Awake() { clanMembers = PersistantData.GetSavedClanData(); if (clanMembers.Count > 0) { ButtonText.text = "Continue"; } else { ButtonText.text = "Quit"; PersistantData.ClearSaves(); } }
/// <summary> /// Save data from path /// </summary> public void Save(PersistantData data) { if (!data.GetType().IsSerializable) { return; } BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + data.GetFilePath()); bf.Serialize(file, data); file.Close(); Debug.Log(data.GetFilePath() + " saved!"); }
//create controller in each scene and persist and replace/destroy anything that is not this void Awake() { if(data == null) { DontDestroyOnLoad(gameObject); data = this; } else if(data != null) { Destroy(gameObject); } for(int index = 0; index < megaBytesPerLevel.Length; index++) megaBytesPerLevel[index] = new bool[3]; #if UNITY_EDITOR SaveAllData();//REMOVE: This line needs to be removed after testing #endif LoadAllData(); }