SphereMirror.cs 454 B

12345678910111213141516171819202122
  1. using UnityEngine;
  2. using System.Collections;
  3. public class SphereMirror : MonoBehaviour {
  4. // Use this for initialization
  5. void Start () {
  6. Vector2 [] vec2UVs= transform.GetComponent<MeshFilter>().mesh.uv;
  7. for(int i = 0; i < vec2UVs.Length; i++)
  8. {
  9. vec2UVs[i] = new Vector2(1.0f -vec2UVs[i].x, vec2UVs[i].y);
  10. }
  11. transform.GetComponent<MeshFilter>().mesh.uv = vec2UVs;
  12. }
  13. // Update is called once per frame
  14. void Update () {
  15. }
  16. }