Example #1
0
    protected override void Awake()
    {
        currentHive =
            JsonLoader.LoadFromJSON <HiveData>(PlayerPrefs.GetString("CurrentHivePath"));
        today = DateTime.Today;

        base.Awake();
    }
Example #2
0
    /// <summary>
    /// Setup scene based on currenntHive (loaded from PlayerPrefs path)
    /// </summary>
    void SetupCurrentHive()
    {
        HiveData currentHive =
            JsonLoader.LoadFromJSON <HiveData>(PlayerPrefs.GetString("CurrentHivePath"));

        // Setup texts
        hiveNameLabel.text = "Beute " + currentHive.number;
        hiveInfoLabel.text =
            "Beute " + currentHive.number + "\n" +
            currentHive.location;

        hiveGalleryItem.Setup(currentHive);
        checkupGallery.Setup(currentHive.id);
    }
Example #3
0
    /// <summary>
    /// Initialize references, initialize dataObject
    /// </summary>
    protected virtual void Awake()
    {
        obligatoryFieldFilled   = new Dictionary <string, bool>();
        inputDisplaysByDataType = new Dictionary <string, InputDisplay>();

        // load existing dataObject if PlayerPrefs variable is set
        if (PlayerPrefs.GetString(dataModifier.currentDataObjectPath, "") != "")
        {
            dataObject = JsonLoader.LoadFromJSON <T>(
                PlayerPrefs.GetString(dataModifier.currentDataObjectPath));
            OnDataObjectLoaded();
        }
        // create new dataObject
        else
        {
            dataObject = CreateNewDataObject();
        }
    }