Example #1
0
    public static QuestDto[] InitQuests()
    {
        if (_qw == null)
        {
            // wait for quests file to download.
            while (!File.Exists(QuestsFile))
            {
            }

            var result = File.ReadAllText(QuestsFile);
            _qw = JsonUtility.FromJson <QuestsWrapper>(result);
        }


        // ReSharper disable once SwitchStatementMissingSomeCases
        switch (SceneManagementUtil.ActiveScene)
        {
        case SceneManagementUtil.Scenes.Kabe: return(_qw.fil);

        case SceneManagementUtil.Scenes.HzMuhammed: return(_qw.hakem);

        case SceneManagementUtil.Scenes.Hamza: return(_qw.hamza);

        case SceneManagementUtil.Scenes.Hatice: return(_qw.kamer);

        case SceneManagementUtil.Scenes.Ebubekir: return(_qw.hicret);

        // fall-through
        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Example #2
0
        public bool Sync(QuestsWrapper qw)
        {
            var sync = Util.Sync(fil, qw.fil, "fil");

            sync = sync && Util.Sync(hakem, qw.hakem, "hakem");
            sync = sync && Util.Sync(hamza, qw.hamza, "hamza");
            sync = sync && Util.Sync(kamer, qw.kamer, "kamer");
            sync = sync && Util.Sync(hicret, qw.hicret, "hicret");
            return(sync);
        }
Example #3
0
    public static void LoadQuestsFile()
    {
        if (_qw != null)
        {
            return;
        }
        // wait for quests file to download.
        var result = File.ReadAllText(QuestsFile);

        _qw = JsonUtility.FromJson <QuestsWrapper>(result);
    }