blob: 3d1969355e6aba1c6cd62735d4b3e5f8d2ae050f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using System.Collections;
using TMPro;
using UnityEngine;
public class EnvMapAnimator : MonoBehaviour
{
public Vector3 RotationSpeeds;
private TMP_Text m_textMeshPro;
private Material m_material;
private void Awake()
{
m_textMeshPro = GetComponent<TMP_Text>();
m_material = m_textMeshPro.fontSharedMaterial;
}
private IEnumerator Start()
{
Matrix4x4 matrix = default(Matrix4x4);
while (true)
{
matrix.SetTRS(Vector3.zero, Quaternion.Euler(Time.time * RotationSpeeds.x, Time.time * RotationSpeeds.y, Time.time * RotationSpeeds.z), Vector3.one);
m_material.SetMatrix("_EnvMatrix", matrix);
yield return null;
}
}
}
|