Ejemplo n.º 1
0
    void SwitchToCollection(int id)
    {
        collectionView.LoadCollection(id);
        currentMode = CERNData.Field.Collection;

        recordView.text.transform.localPosition     = spawnPosition;
        keywordView.text.transform.localPosition    = spawnPosition;
        collectionView.text.transform.localPosition = Vector3.zero;
    }
Ejemplo n.º 2
0
    void SwitchToRecord(int id)
    {
        recordView.LoadRecord(id);
        currentMode = CERNData.Field.Record;
        bool  onImage = recordView.OnImage();
        Image img     = imageElement.GetComponent <Image> ();

        if (onImage)
        {
            img.enabled = true;
            var path = CERNData.archive.jsonPath + "/Photos/" + recordView.ImagePath();
            Debug.Log("loading new image: " + path);
            img.sprite = IMG2Sprite.instance.LoadNewSprite(path);
            img.transform.localScale = new Vector3((float)img.sprite.texture.width / (float)img.sprite.texture.height, 1f, 1f);
        }
        else
        {
            img.enabled = false;
        }
        recordView.text.transform.localPosition     = Vector3.zero;
        keywordView.text.transform.localPosition    = spawnPosition;
        collectionView.text.transform.localPosition = spawnPosition;
    }