SunCorona.cs 458 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SunCorona : MonoBehaviour
  5. {
  6. Material mat;
  7. Vector2 offset;
  8. public Vector2 speed = new Vector2(1, 1);
  9. void Start () {
  10. mat = GetComponent<Renderer>().sharedMaterial;
  11. }
  12. // Update is called once per frame
  13. void Update () {
  14. offset += speed * Time.deltaTime;
  15. mat.SetTextureOffset("_MainTex", offset);
  16. }
  17. }