示例#1
0
 /// <summary>
 /// Constuct remote quest object from manifest data
 /// </summary>
 /// <param name="kv">manifest data</param>
 public RemoteQuest(KeyValuePair <string, Dictionary <string, string> > kv)
 {
     name = kv.Key;
     path = QuestDownload.GetServerLocation();
     data = kv.Value;
     if (data.ContainsKey("external"))
     {
         path = data["external"];
     }
 }
示例#2
0
        /// <summary>
        /// Fetch next required file
        /// </summary>
        /// <param name="qd">QuestDownloadObeject to use</param>
        /// <param name="call">Function to call after download</param>
        /// <returns>true if no downloads required</returns>
        public bool FetchContent(QuestDownload qd, UnityEngine.Events.UnityAction call)
        {
            if (data.ContainsKey("external"))
            {
                if (iniError)
                {
                    return(true);
                }

                qd.StartCoroutine(qd.Download(path + name + ".ini", delegate { IniFetched(qd.download, call); }));
                return(false);
            }
            if (data.ContainsKey("image") && data["image"].Length > 0)
            {
                if (image == null && !imageError)
                {
                    qd.StartCoroutine(qd.Download(path + data["image"], delegate { ImageFetched(qd.download, call); }));
                    return(false);
                }
            }
            return(true);
        }