예제 #1
0
    public void SameHeightSwitch()
    {
        if (proportionMode == 2)
        {
            return;
        }
        proportionMode = 2;
        if (imageList.Count == 0)
        {
            return;
        }

        getIndex();
        RawImage ri         = imageList[index].GetComponent <RawImage>();
        float    baseHeight = imageList[index].transform.localScale.x * ri.texture.height;

        for (int i = 0; i < imageList.Count; i++)
        {
            UniGifImage gifScript = imageList[i].GetComponent <UniGifImage>();
            if (gifScript != null)
            {
                gifScript.Play();
            }
            ri = imageList[i].GetComponent <RawImage>();
            // Rescales images so they all have the same height as baseHeight
            float newScale = baseHeight / ri.texture.height;
            if (gifScript != null)
            {
                gifScript.Stop();
            }
            imageList[i].transform.localScale = newScale * Vector3.one;
        }

        RecalculateArrangement();
    }
예제 #2
0
 public void OnButtonClicked()
 {
     if (m_mutex == false && m_uniGifImage != null && string.IsNullOrEmpty(m_inputField.text) == false)
     {
         m_mutex = true;
         m_uniGifImage.Stop();
         StartCoroutine(ViewGifCoroutine());
     }
 }
예제 #3
0
 void OnEnable()
 {
     gifSaved = false;
     if (Record.m_Recorder != null)
     {
         Record.m_Recorder.Save();
         Record.m_Recorder.OnFileSaved += OnGifSaved;
     }
     uniGifImage.Stop();
     image.enabled = false;
     LoadingImage.gameObject.SetActive(true);
 }
예제 #4
0
    /*
     * public void ReloadImage()
     * {
     *  // Needs special check for whether image is a .gif
     *  print("Index: " + index); // 0 remains out of range
     *  //while (textureLists.Count <= index)
     *  //    print("Waiting for load..."); // this approach causes Unity to freeze
     *  img.texture = textureLists[index];
     *  Vector2 sDelta = 0.02f * Mathf.Pow(scaleFactor, 2) * (new Vector2(img.texture.width, img.texture.height));
     *  img.rectTransform.sizeDelta = sDelta;
     *  imgCollider.size = new Vector3(sDelta.x, sDelta.y, .01f);
     * }
     */
    public void DisableImage(int imageIndex)
    {
        GameObject  curImgObj = imageList[imageIndex];
        UniGifImage gifScript = curImgObj.GetComponent <UniGifImage>();

        if (gifScript != null)
        {
            print("StoppingGif");
            gifScript.Stop();
        }
        RawImage    curImg  = curImgObj.GetComponent <RawImage>();
        BoxCollider curColl = curImgObj.GetComponent <BoxCollider>();

        curColl.enabled = false;
        curImg.enabled  = false;
    }
예제 #5
0
파일: GIFer.cs 프로젝트: Auros/AlphaTwitch
 public void HideGIFer()
 {
     _panelLeftG.enabled = false;
     gifimage.Stop();
 }