Esempio n. 1
0
 public void Init()
 {
     if (sessionData == null || sessionData.Length == 0)
     {
         sessionData = PersistantData.Load();
     }
 }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     if (pd == null)
     {
         pd = FindObjectOfType <PersistantData>();
     }
 }
Esempio n. 3
0
    void save()
    {
        string path = Application.dataPath + "/Resources/Data/Enemies";
        var    data = PersistantData.SerializeToBytes(_teamList);

        PersistantData.SaveBytesToFile(Application.dataPath + "/Resources/Data/Enemies/", "Teams.bytes", data);
    }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
    // 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);
    }
Esempio n. 6
0
    // 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;
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        data             = PersistantData.instance;
        itemList         = new List <Pokemon>();
        buttonObjectPool = GetComponent <ButtonPool>();

        RefreshDisplay();
    }
Esempio n. 8
0
    // 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());
    }
Esempio n. 10
0
 void Start()
 {
     if (data == null)
     {
         data = FindObjectOfType <PersistantData>();
     }
     YellowSector.SetActive(data.unlockYellow);
 }
Esempio n. 11
0
 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();
     }
 }
Esempio n. 12
0
 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");
 }
Esempio n. 14
0
    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);
        }
    }
Esempio n. 15
0
    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);
        }
    }
Esempio n. 16
0
    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);
     }
 }
Esempio n. 19
0
 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);
 }
Esempio n. 20
0
    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();
        }
    }
Esempio n. 21
0
 private void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (currInstance == null)
     {
         currInstance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 22
0
 private void Awake()
 {
     brando = true;
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Esempio n. 23
0
 void Awake()
 {
     if (Instance)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
 }
Esempio n. 24
0
    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");
        }
    }
Esempio n. 25
0
 private void OnEnable()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Debug.Log("Instance Already Exists, Destroying This...");
         Destroy(this.gameObject);
     }
 }
Esempio n. 26
0
 private void Awake()
 {
     DontDestroyOnLoad(gameObject);
     numberOfDeaths = -1;
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 27
0
    // Use this for initialization
    void Start()
    {
        if (m_instance == null)
        {
            m_instance = this;
        }
        else
        {
            Destroy(this);
        }

        DontDestroyOnLoad(this);
    }
Esempio n. 28
0
    public void Continue()
    {
        var ClanMembers = PersistantData.GetSavedClanData();

        if (ClanMembers.Count > 0)
        {
            SceneManager.LoadScene(BaracksScene);
        }
        else
        {
            SceneManager.LoadScene(MainMenuScene);
        }
    }
Esempio n. 29
0
 private void Awake()
 {
     clanMembers = PersistantData.GetSavedClanData();
     if (clanMembers.Count > 0)
     {
         ButtonText.text = "Continue";
     }
     else
     {
         ButtonText.text = "Quit";
         PersistantData.ClearSaves();
     }
 }
Esempio n. 30
0
    /// <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!");
    }
Esempio n. 31
0
    //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();
    }