Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

mainTextureOffse causes performance issue. How to resolve it ?

$
0
0
Hello, when this script is activated, I have low framerate and performance issue.

Code (CSharp):
  1. public class turn_texture : MonoBehaviour {
  2.  
  3.     public float offset;
  4.     public float speed;
  5.  
  6.     public float reset;
  7.    
  8.  
  9.     void Start () {
  10.  
  11.  
  12.    
  13.     }
  14.  
  15.     void Update() {
  16.  
  17.         if ( offset < 0.3f){
  18.        
  19.             float zag = Time.timeSinceLevelLoad - reset;
  20.             offset = zag * speed;
  21.             this.renderer.material.mainTextureOffset = new Vector2(0, offset);
  22.    
  23.         }...
mainTextureOffse causes performance issue. How to resolve it ?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>