GetTexture() public method

public GetTexture ( ) : Texture2D
return UnityEngine.Texture2D
Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        if (SVGFile != null) {
          Stopwatch w = new Stopwatch();

          w.Reset();
          w.Start();
          ISVGDevice device;
          if(useFastButBloatedRenderer)
        device = new SVGDeviceFast();
          else
        device = new SVGDeviceSmall();
          m_implement = new Implement(this.SVGFile, device);
          w.Stop();
          long c = w.ElapsedMilliseconds;

          w.Reset();
          w.Start();
          m_implement.StartProcess();
          w.Stop();
          long p = w.ElapsedMilliseconds;

          w.Reset();
          w.Start();
          renderer.material.mainTexture = m_implement.GetTexture();
          w.Stop();
          long r = w.ElapsedMilliseconds;
          UnityEngine.Debug.Log("Construction: " + Format(c) + ", Processing: " + Format(p) + ", Rendering: " + Format(r));

          Vector2 ts = renderer.material.mainTextureScale;
          ts.x *= -1;
          renderer.material.mainTextureScale = ts;
          renderer.material.mainTexture.filterMode = FilterMode.Trilinear;
        }
    }
Beispiel #2
0
    private void Start()
    {
        //yield return new WaitForSeconds(0.1f);
        if (SVGFile != null)
        {
            Stopwatch w = new Stopwatch();

            w.Reset();
            w.Start();
            ISVGDevice device;
            if (useFastButBloatedRenderer)
            {
                device = new SVGDeviceFast();
            }
            else
            {
                device = new SVGDeviceSmall();
            }
            var implement = new Implement(SVGFile, device);
            w.Stop();
            long c = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            implement.StartProcess();
            w.Stop();
            long p = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            var myRenderer = GetComponent <Renderer>();
            myRenderer.material.mainTexture = implement.GetTexture();
            w.Stop();
            long r = w.ElapsedMilliseconds;
            UnityEngine.Debug.LogFormat("Construction: {0} ms, Processing: {1} ms, Rendering: {2} ms", c, p, r);

            Vector2 ts = myRenderer.material.mainTextureScale;
            ts.x *= -1;
            myRenderer.material.mainTextureScale       = ts;
            myRenderer.material.mainTexture.filterMode = FilterMode.Trilinear;
        }
    }
Beispiel #3
0
    private void Start()
    {
        //yield return new WaitForSeconds(0.1f);
        if (SVGFile != null)
        {
            Stopwatch w = new Stopwatch();

            w.Reset();
            w.Start();
            ISVGDevice device;
            if (fastRenderer)
            {
                device = new SVGDeviceFast();
            }
            else
            {
                device = new SVGDeviceSmall();
            }
            var implement = new Implement(SVGFile, device);
            w.Stop();
            long c = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            implement.StartProcess();
            w.Stop();
            long p = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            var myRenderer = GetComponent <Renderer>();
            var result     = implement.GetTexture();
            result.wrapMode   = wrapMode;
            result.filterMode = filterMode;
            result.anisoLevel = anisoLevel;
            myRenderer.material.mainTexture = result;
            w.Stop();
            long r = w.ElapsedMilliseconds;
            UnityEngine.Debug.LogFormat("Construction: {0} ms, Processing: {1} ms, Rendering: {2} ms", c, p, r);
        }
    }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        if (SVGFile != null)
        {
            Stopwatch w = new Stopwatch();

            w.Reset();
            w.Start();
            ISVGDevice device;
            if (useFastButBloatedRenderer)
            {
                device = new SVGDeviceFast();
            }
            else
            {
                device = new SVGDeviceSmall();
            }
            m_implement = new Implement(this.SVGFile, device);
            w.Stop();
            long c = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            m_implement.StartProcess();
            w.Stop();
            long p = w.ElapsedMilliseconds;

            w.Reset();
            w.Start();
            renderer.material.mainTexture = m_implement.GetTexture();
            w.Stop();
            long r = w.ElapsedMilliseconds;
            UnityEngine.Debug.Log("Construction: " + Format(c) + ", Processing: " + Format(p) + ", Rendering: " + Format(r));

            Vector2 ts = renderer.material.mainTextureScale;
            ts.x *= -1;
            renderer.material.mainTextureScale       = ts;
            renderer.material.mainTexture.filterMode = FilterMode.Trilinear;
        }
    }
Beispiel #5
0
    private void Start()
    {
        //yield return new WaitForSeconds(0.1f);
        if(SVGFile != null) {
          Stopwatch w = new Stopwatch();

          w.Reset();
          w.Start();
          ISVGDevice device;
          if(fastRenderer)
        device = new SVGDeviceFast();
          else
        device = new SVGDeviceSmall();
          var implement = new Implement(SVGFile, device);
          w.Stop();
          long c = w.ElapsedMilliseconds;

          w.Reset();
          w.Start();
          implement.StartProcess();
          w.Stop();
          long p = w.ElapsedMilliseconds;

          w.Reset();
          w.Start();
          var myRenderer = GetComponent<Renderer>();
          var result = implement.GetTexture();
          result.wrapMode   = wrapMode;
          result.filterMode = filterMode;
          result.anisoLevel = anisoLevel;
          myRenderer.material.mainTexture = result;
          w.Stop();
          long r = w.ElapsedMilliseconds;
          UnityEngine.Debug.LogFormat("Construction: {0} ms, Processing: {1} ms, Rendering: {2} ms", c, p, r);
        }
    }