r2mods/ilspy_dump/ror2_csproj/RoR2/Billboard.cs

35 lines
712 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using System.Collections.Generic;
using UnityEngine;
namespace RoR2;
public class Billboard : MonoBehaviour
{
private static List<Transform> instanceTransformsList;
static Billboard()
{
instanceTransformsList = new List<Transform>();
SceneCamera.onSceneCameraPreCull += OnSceneCameraPreCull;
}
private static void OnSceneCameraPreCull(SceneCamera sceneCamera)
{
Quaternion rotation = sceneCamera.transform.rotation;
for (int i = 0; i < instanceTransformsList.Count; i++)
{
instanceTransformsList[i].rotation = rotation;
}
}
private void OnEnable()
{
instanceTransformsList.Add(base.transform);
}
private void OnDisable()
{
instanceTransformsList.Remove(base.transform);
}
}