- Tweaked font SDF maps to be much smaller in size while still looking good. - Loot image downloading is now handled globally by CaseManager. - LocationBoard and MissingPoster now get their loot image from CaseManager. - Recompressed a lot of textures to try to save space. - Enabled streaming mipmaps on all textures, and texture streaming globally. - Updated occlusion culling data for the first time in a while.
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
|
|
using TMPro;
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDK3.Image;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon.Common;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class MissingPoster : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private TextMeshProUGUI _LootName;
|
|
[Space]
|
|
[SerializeField] private MeshRenderer _MissingPosterMesh;
|
|
[SerializeField] private Texture _DefaultPortrait;
|
|
[SerializeField] private string _DefaultLootName;
|
|
|
|
[UdonSynced] private VRCUrl _LootImageURL;
|
|
[UdonSynced] private string _Name = "";
|
|
|
|
private Material _PortraitMaterial = null;
|
|
|
|
|
|
private void Start()
|
|
{
|
|
_PortraitMaterial = _MissingPosterMesh.materials[2];
|
|
}
|
|
|
|
public override void OnDeserialization(DeserializationResult Result)
|
|
{
|
|
_ApplyNewConfiguration();
|
|
base.OnDeserialization(Result);
|
|
}
|
|
|
|
|
|
public void SetNewLootName(string Name)
|
|
{
|
|
_Name = Name;
|
|
_ApplyNewConfiguration();
|
|
RequestSerialization();
|
|
}
|
|
|
|
public void ApplyLootImage(Texture2D Loot)
|
|
{
|
|
_PortraitMaterial.SetTexture("_MainTex", Loot);
|
|
}
|
|
|
|
private void _ApplyNewConfiguration()
|
|
{
|
|
_LootName.text = _Name;
|
|
}
|
|
}
|