cvr-props/Assets/ABI.CCK/Components/CVRAssetInfo.cs

45 lines
1.2 KiB
C#
Raw Normal View History

using ABI.CCK.Scripts;
2023-01-22 16:38:23 +01:00
using UnityEngine;
namespace ABI.CCK.Components
{
[AddComponentMenu("")]
[DisallowMultipleComponent]
[HelpURL("https://developers.abinteractive.net/cck/components/asset-info/")]
public class CVRAssetInfo : MonoBehaviour, ICCK_Component
2023-01-22 16:38:23 +01:00
{
public enum AssetType
{
Avatar = 1,
World = 2,
Spawnable = 3
}
public AssetType type;
public string objectId;
2023-07-30 01:20:46 +02:00
[HideInInspector]
public string randomNum;
[HideInInspector]
public string unityVersion;
[HideInInspector]
public string cckVersion;
// just to make sure
private void OnValidate() => Reset();
private void Reset()
{
unityVersion = Application.unityVersion;
cckVersion = $"{CVRCommon.CCK_VERSION_NUMBER}:{CVRCommon.CCK_BUILD_NUMBER}";
if (TryGetComponent(out CVRAvatar _))
type = AssetType.Avatar;
if (TryGetComponent(out CVRWorld _))
type = AssetType.World;
if (TryGetComponent(out CVRSpawnable _))
type = AssetType.Spawnable;
}
2023-01-22 16:38:23 +01:00
}
}