Week5 Sprint
For this week, I was working on this texture
float offsetX, offsetY, realtime; new Vector2 origin; public float speed = 1; // make it -0.1 in Unity public double rooptime = 3.9; void Start() { offsetX = this.GetComponent<Renderer>().material.mainTextureOffset.x; offsetY = this.GetComponent<Renderer>().material.mainTextureOffset.y; origin = new Vector2(offsetX, offsetY); } void Update() { realtime += Time.deltaTime; offsetY = realtime * speed; this.GetComponent<Renderer>().material.mainTextureOffset = new Vector2(offsetX, offsetY); if(realtime > rooptime) { realtime = 0; } }
Comments
Post a Comment