/// <summary>
    /// this is the entry point for gettng message from lifecycle manager in adapter scen
    /// </summary>
    /// <param name="json"></param>
    public void JsonFromLifeCycleManager(string json)
    {
        Logger.Log(json);

        //parsing json
        ImageVideoTemplateCollection imageVideoTemplateCollection = new ImageVideoTemplateCollection();

        imageVideoTemplateCollection = JsonUtility.FromJson <ImageVideoTemplateCollection>(json);

        //assign image url from parsed json to currentImageURL
        currentImageURl = imageVideoTemplateCollection.arList[0].targetImageUrl;

        if (imageUrlsAddedToLibrary.Contains(currentImageURl))
        {
            Logger.Log("image already downloaded now ready for tracking");
            OnReadyForTracking();
        }
        else
        {
            Logger.Log("image not already downloaded now initiating download and library addition process");


            imageVideoTemplate = imageVideoTemplateCollection.arList[0];

            Logger.Log(imageVideoTemplateCollection.arList[0].targetImageUrl);


            SendData();
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Generate ARVideoObj based on specifications (input params(
    /// </summary>
    /// <param name="imageTargetTemplate">image target template</param>
    /// <param name="objectName"> name to be given for object going to be generated (instantiated) </param>
    /// <returns></returns>

    public GameObject CreateARVideoObject(ImageVideoTemplate imageTargetTemplate, string objectName)
    {
        //instantiate object
        GameObject go = Instantiate <GameObject>(videoPrefab);

        go.name = objectName;

        //in arobj component set video url
        var arobj = go.GetComponentInChildren <ARVideoObject>();

        arobj.VideoUrl = imageTargetTemplate.targetVideoUrl;

        //arvideo obj ui is nested object reponsible for ARVideoObj's UI related stuffs, so update ui related stuffs here.
        arobj.arVideoObjUIPrefab.GetComponent <ARVideoObjUI>().SetUIData(imageTargetTemplate.adsInfo, imageTargetTemplate.adsRedirectUrl);
        //TODO delete ads redirect url comment line below
        Logger.Log("In factory testing ads redirect url " + imageTargetTemplate.adsRedirectUrl);

        Logger.Log("video obj instantiated");
        return(go);
    }