mirror of
https://git.aaro.dev/VRCBoard/vrcboard-udon.git
synced 2026-03-17 02:49:46 +00:00
Add new meta files and initial implementations for VRCBoard components and materials
This commit is contained in:
116
Components/VRCBoardBaseComponent.cs
Normal file
116
Components/VRCBoardBaseComponent.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
namespace VRCBoard.Components
|
||||
{
|
||||
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
|
||||
public abstract class VRCBoardBaseComponent : UdonSharpBehaviour
|
||||
{
|
||||
[HideInInspector] public VRCBoardManager manager;
|
||||
|
||||
protected abstract void OnRegister();
|
||||
protected abstract void OnInitialize();
|
||||
protected abstract void OnSupporterDataUpdate();
|
||||
protected abstract void OnImageDataUpdate();
|
||||
protected abstract void OnImageLoaded();
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
protected internal void _Register(VRCBoardManager _manager)
|
||||
{
|
||||
manager = _manager;
|
||||
OnRegister();
|
||||
}
|
||||
|
||||
private bool _imageInitialized;
|
||||
private bool _dataInitialized;
|
||||
private bool _initialized;
|
||||
private void CheckInitialization()
|
||||
{
|
||||
if (_imageInitialized && _dataInitialized && !_initialized)
|
||||
{
|
||||
_initialized = true;
|
||||
OnInitialize();
|
||||
OnImageDataUpdate();
|
||||
OnSupporterDataUpdate();
|
||||
}
|
||||
}
|
||||
protected internal void _OnImageInfoUpdate()
|
||||
{
|
||||
if (_initialized) OnImageDataUpdate();
|
||||
else
|
||||
{
|
||||
_imageInitialized = true;
|
||||
CheckInitialization();
|
||||
}
|
||||
|
||||
}
|
||||
protected internal void _OnSupporterDataUpdate()
|
||||
{
|
||||
if (_initialized) OnSupporterDataUpdate();
|
||||
else
|
||||
{
|
||||
_dataInitialized = true;
|
||||
CheckInitialization();
|
||||
}
|
||||
}
|
||||
|
||||
protected internal void _OnImageLoaded(int atlasIndex = -1)
|
||||
{
|
||||
OnImageLoaded();
|
||||
}
|
||||
|
||||
private DataDictionary GetImageIdInfo(string imageId) => manager._GetImageIdInfo(imageId);
|
||||
|
||||
internal bool GetImageAtlasTexture(string imageId, string uploader, out Texture2D texture,
|
||||
out int position, out int size, out string type) {
|
||||
return manager._GetImageAtlasTexture(imageId, uploader, out int atlasIndex, out texture, out position, out size,
|
||||
out type);
|
||||
}
|
||||
|
||||
|
||||
internal string GetRandomUploader(string imageId)
|
||||
{
|
||||
DataDictionary imageInfo = GetImageIdInfo(imageId);
|
||||
if (imageInfo == null) return null;
|
||||
bool uploadsSuccess = imageInfo.TryGetValue("uploads", out DataToken uploadsToken);
|
||||
if (!uploadsSuccess) return null;
|
||||
if (uploadsToken.TokenType != TokenType.DataList) return null;
|
||||
DataList uploads = uploadsToken.DataList;
|
||||
if (uploads.Count == 0) return null;
|
||||
int randomIndex = Random.Range(0, uploads.Count);
|
||||
DataDictionary upload = uploads[randomIndex].DataDictionary;
|
||||
if (upload == null) return null;
|
||||
bool uploaderSuccess = upload.TryGetValue("a", out DataToken uploaderToken);
|
||||
if (!uploaderSuccess) return null;
|
||||
if (uploaderToken.TokenType != TokenType.String) return null;
|
||||
return uploaderToken.String;
|
||||
}
|
||||
|
||||
internal void RequestImageLoad(string imageId, string uploaderId = "")
|
||||
{
|
||||
manager._RequestImageLoad(imageId, uploaderId, this);
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR && !COMPILER_UDONSHARP
|
||||
[CustomEditor(typeof(VRCBoardBaseComponent), true)]
|
||||
public class VRCBoardBaseComponentEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.LabelField("Cannot edit a VRCBoard component while in play mode");
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
11
Components/VRCBoardBaseComponent.cs.meta
Normal file
11
Components/VRCBoardBaseComponent.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eeb8a49e78fdf45439cb6d35397f8774
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
944
Components/VRCBoardImage.asset
Normal file
944
Components/VRCBoardImage.asset
Normal file
@@ -0,0 +1,944 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardImage
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: f83f88ce349d298438a783df6b33c10f,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: 63987f0853a8d0d44bd6ea28693af468, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 1
|
||||
hasInteractEvent: 0
|
||||
scriptID: -7602492438531743077
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 16
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: manager
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: manager
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRCBoard.VRCBoardManager, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.Udon.UdonBehaviour, VRC.Udon
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 6|UnityEngine.HideInInspector, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _imageInitialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _imageInitialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _dataInitialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _dataInitialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _initialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _initialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: uploaderIdOverride
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: uploaderIdOverride
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 15|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 17|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
|
||||
- Name: header
|
||||
Entry: 1
|
||||
Data: Uploader ID (only applies to images of 'shared' or 'instance' type)
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: albedoImageId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: albedoImageId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 20|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
|
||||
- Name: header
|
||||
Entry: 1
|
||||
Data: Image IDs
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: emissionImageId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: emissionImageId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: normalImageId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: normalImageId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: defaultAlbedo
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: defaultAlbedo
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 26|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Texture2D, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 28|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
|
||||
- Name: header
|
||||
Entry: 1
|
||||
Data: Defaults
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: albedoColor
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: albedoColor
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 30|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Color, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 30
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 32|UnityEngine.ColorUsageAttribute, UnityEngine.CoreModule
|
||||
- Name: showAlpha
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: hdr
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: minBrightness
|
||||
Entry: 4
|
||||
Data: 0
|
||||
- Name: maxBrightness
|
||||
Entry: 4
|
||||
Data: 8
|
||||
- Name: minExposureValue
|
||||
Entry: 4
|
||||
Data: 0.125
|
||||
- Name: maxExposureValue
|
||||
Entry: 4
|
||||
Data: 3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: defaultEmission
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: defaultEmission
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: emissionColor
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: emissionColor
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 30
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 30
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 37|UnityEngine.ColorUsageAttribute, UnityEngine.CoreModule
|
||||
- Name: showAlpha
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: hdr
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: minBrightness
|
||||
Entry: 4
|
||||
Data: 0
|
||||
- Name: maxBrightness
|
||||
Entry: 4
|
||||
Data: 8
|
||||
- Name: minExposureValue
|
||||
Entry: 4
|
||||
Data: 0.125
|
||||
- Name: maxExposureValue
|
||||
Entry: 4
|
||||
Data: 3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: defaultNormal
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: defaultNormal
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: normalIntensity
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: normalIntensity
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 41|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _mainType
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _mainType
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _uploaderId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _uploaderId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
8
Components/VRCBoardImage.asset.meta
Normal file
8
Components/VRCBoardImage.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac7f998a74898ea4ead01ba49e49e658
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
179
Components/VRCBoardImage.cs
Normal file
179
Components/VRCBoardImage.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using VRC.SDK3.Data;
|
||||
|
||||
namespace VRCBoard.Components
|
||||
{
|
||||
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
|
||||
public class VRCBoardImage : VRCBoardBaseComponent
|
||||
{
|
||||
[Header("Uploader ID (only applies to images of 'shared' or 'instance' type)")]
|
||||
public string uploaderIdOverride;
|
||||
|
||||
[Header("Image IDs")]
|
||||
public string albedoImageId;
|
||||
public string emissionImageId;
|
||||
public string normalImageId;
|
||||
|
||||
[Header("Defaults")]
|
||||
public Texture2D defaultAlbedo;
|
||||
[ColorUsageAttribute(true,true)] public Color albedoColor = Color.white;
|
||||
public Texture2D defaultEmission;
|
||||
[ColorUsageAttribute(true,true)] public Color emissionColor = Color.white;
|
||||
public Texture2D defaultNormal;
|
||||
public float normalIntensity = 1.0f;
|
||||
|
||||
|
||||
private string _mainType = "";
|
||||
private string _uploaderId = "";
|
||||
|
||||
protected override void OnRegister()
|
||||
{
|
||||
MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock();
|
||||
Debug.Log("Registering image component");
|
||||
if (defaultAlbedo)
|
||||
_propertyBlock.SetTexture("_MainTexAtlas", defaultAlbedo);
|
||||
|
||||
if (defaultEmission)
|
||||
_propertyBlock.SetTexture("_EmissionMapAtlas", defaultEmission);
|
||||
|
||||
if (defaultNormal)
|
||||
_propertyBlock.SetTexture("_NormalMapAtlas", defaultNormal);
|
||||
|
||||
_propertyBlock.SetInteger("_MainTexAtlasIndex", 0);
|
||||
_propertyBlock.SetInteger("_MainTexAtlasSize", 1);
|
||||
_propertyBlock.SetInteger("_EmissionMapAtlasIndex", 0);
|
||||
_propertyBlock.SetInteger("_EmissionMapAtlasSize", 1);
|
||||
_propertyBlock.SetInteger("_NormalMapAtlasIndex", 0);
|
||||
_propertyBlock.SetInteger("_NormalMapAtlasSize", 1);
|
||||
|
||||
_propertyBlock.SetColor("_EmissionColor", emissionColor);
|
||||
_propertyBlock.SetFloat("_NormalMapScale", normalIntensity);
|
||||
_propertyBlock.SetColor("_MainTexColor", albedoColor);
|
||||
|
||||
GetComponent<Renderer>().SetPropertyBlock(_propertyBlock);
|
||||
}
|
||||
|
||||
|
||||
private string GetUploader()
|
||||
{
|
||||
string uploaderId = "";
|
||||
if (string.IsNullOrEmpty(uploaderIdOverride))
|
||||
{
|
||||
GetImageAtlasTexture(albedoImageId, null, out Texture2D albedoTexture, out int albedoAtlasPosition, out int albedoAtlasSize, out string albedoType);
|
||||
if (albedoType == null)
|
||||
{
|
||||
Debug.LogError("Failed to get image type for albedo image");
|
||||
return "";
|
||||
}
|
||||
_mainType = albedoType;
|
||||
if (_mainType == "shared")
|
||||
{
|
||||
uploaderId = GetRandomUploader(albedoImageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
DataDictionary ownerInfo = manager.GetSupporterDataFromPlayer(manager.instanceOwner);
|
||||
if (ownerInfo == null)
|
||||
{
|
||||
Debug.LogWarning("Failed to get owner info, user has likely not linked their account.");
|
||||
return "";
|
||||
}
|
||||
bool ownerSuccess = ownerInfo.TryGetValue("id", out DataToken ownerToken);
|
||||
if (!ownerSuccess || ownerToken.TokenType != TokenType.String)
|
||||
{
|
||||
Debug.LogWarning("Failed to get owner ID from owner info.");
|
||||
return "";
|
||||
}
|
||||
uploaderId = ownerToken.String;
|
||||
}
|
||||
|
||||
Debug.Log("image uploader: " + uploaderId);
|
||||
} else
|
||||
{
|
||||
uploaderId = uploaderIdOverride;
|
||||
}
|
||||
return uploaderId;
|
||||
}
|
||||
|
||||
private void TryGetUploader()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_uploaderId)) return;
|
||||
_uploaderId = GetUploader();
|
||||
if (string.IsNullOrEmpty(_uploaderId))
|
||||
{
|
||||
Debug.LogError("Failed to get uploader ID");
|
||||
return;
|
||||
}
|
||||
RequestImageLoad(albedoImageId, _uploaderId);
|
||||
RequestImageLoad(emissionImageId, _uploaderId);
|
||||
RequestImageLoad(normalImageId, _uploaderId);
|
||||
}
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
TryGetUploader();
|
||||
}
|
||||
protected override void OnImageDataUpdate()
|
||||
{
|
||||
TryGetUploader();
|
||||
}
|
||||
|
||||
protected override void OnSupporterDataUpdate()
|
||||
{
|
||||
TryGetUploader();
|
||||
}
|
||||
|
||||
protected override void OnImageLoaded()
|
||||
{
|
||||
Debug.Log("Image loaded VRCBoardImage");
|
||||
|
||||
Texture2D albedoTexture;
|
||||
int albedoAtlasPosition;
|
||||
int albedoAtlasSize;
|
||||
|
||||
Texture2D emissionTexture;
|
||||
int emissionAtlasPosition;
|
||||
int emissionAtlasSize;
|
||||
|
||||
Texture2D normalTexture;
|
||||
int normalAtlasPosition;
|
||||
int normalAtlasSize;
|
||||
|
||||
bool albedoSuccess = GetImageAtlasTexture(albedoImageId, _uploaderId, out albedoTexture, out albedoAtlasPosition, out albedoAtlasSize, out string type1);
|
||||
bool emissionSuccess = GetImageAtlasTexture(emissionImageId, _uploaderId, out emissionTexture, out emissionAtlasPosition, out emissionAtlasSize, out string type2);
|
||||
bool normalSuccess = GetImageAtlasTexture(normalImageId, _uploaderId, out normalTexture, out normalAtlasPosition, out normalAtlasSize, out string type3);
|
||||
|
||||
MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock();
|
||||
|
||||
if (albedoSuccess && albedoTexture) {
|
||||
_propertyBlock.SetTexture("_MainTexAtlas", albedoTexture);
|
||||
_propertyBlock.SetInteger("_MainTexAtlasIndex", albedoAtlasPosition);
|
||||
_propertyBlock.SetInteger("_MainTexAtlasSize", albedoAtlasSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (emissionSuccess && emissionTexture) {
|
||||
_propertyBlock.SetTexture("_EmissionMapAtlas", emissionTexture);
|
||||
_propertyBlock.SetInteger("_EmissionMapAtlasIndex", emissionAtlasPosition);
|
||||
_propertyBlock.SetInteger("_EmissionMapAtlasSize", emissionAtlasSize);
|
||||
}
|
||||
|
||||
if (normalSuccess && normalTexture) {
|
||||
_propertyBlock.SetTexture("_NormalMapAtlas", normalTexture);
|
||||
_propertyBlock.SetInteger("_NormalMapAtlasIndex", normalAtlasPosition);
|
||||
_propertyBlock.SetInteger("_NormalMapAtlasSize", normalAtlasSize);
|
||||
}
|
||||
|
||||
_propertyBlock.SetColor("_EmissionColor", emissionColor);
|
||||
_propertyBlock.SetFloat("_NormalMapScale", normalIntensity);
|
||||
_propertyBlock.SetColor("_MainTexColor", albedoColor);
|
||||
|
||||
GetComponent<Renderer>().SetPropertyBlock(_propertyBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
Components/VRCBoardImage.cs.meta
Normal file
11
Components/VRCBoardImage.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63987f0853a8d0d44bd6ea28693af468
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
239
Components/VRCBoardSupporterBoardBase.cs
Normal file
239
Components/VRCBoardSupporterBoardBase.cs
Normal file
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
using VRCBoard.Components;
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
namespace VRCBoard.Components
|
||||
{
|
||||
[Serializable]
|
||||
internal struct BoardEditorConfigEntry
|
||||
{
|
||||
public const int length = 6;
|
||||
[Header("ID")]
|
||||
public IDType IDType;
|
||||
[Tooltip("Uses with this tag / tier will be displayed")]
|
||||
public string id;
|
||||
|
||||
[Header("Styling"), Tooltip("Template to use for this tier, %s will be replaced with the supporter name")]
|
||||
public string template;
|
||||
public string separator;
|
||||
|
||||
[Header("Advanced Options")]
|
||||
public bool userMustBeInWorld;
|
||||
public bool exclusive;
|
||||
|
||||
|
||||
public BoardEditorConfigEntry(string[] data)
|
||||
{
|
||||
IDType = (IDType)Enum.Parse(typeof(IDType), data[0]);
|
||||
id = data[1];
|
||||
template = data[2];
|
||||
separator = data[3];
|
||||
userMustBeInWorld = data[4] == "1";
|
||||
exclusive = data[5] == "1";
|
||||
}
|
||||
public string[] ToArray()
|
||||
{
|
||||
string[] result = new string[length];
|
||||
result[0] = IDType.ToString();
|
||||
result[1] = id;
|
||||
result[2] = template;
|
||||
result[3] = separator;
|
||||
result[4] = userMustBeInWorld ? "1" : "0";
|
||||
result[5] = exclusive ? "1" : "0";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public abstract class VRCBoardSupporterBoardBase : VRCBoardBaseComponent
|
||||
{
|
||||
[SerializeField] internal string Separator = "\\n";
|
||||
[SerializeField] internal BoardEditorConfigEntry[] ConfigEntries = new BoardEditorConfigEntry[0];
|
||||
internal int configLength => config.Length/BoardEditorConfigEntry.length;
|
||||
private string GetSeparator(string sep)
|
||||
{
|
||||
sep = sep.Replace("\\n", "\n");
|
||||
sep = sep.Replace("\\t", "\t");
|
||||
return sep;
|
||||
}
|
||||
|
||||
[HideInInspector] public string[] config = new string[0];
|
||||
private string _supporterList = "";
|
||||
|
||||
|
||||
protected abstract void UpdateSupporterBoard(string supporterList);
|
||||
protected override void OnRegister() { }
|
||||
|
||||
private string RemovePrefix(string node, string prefix)
|
||||
{
|
||||
if (node.StartsWith(prefix))
|
||||
return node.Substring(prefix.Length);
|
||||
return node;
|
||||
}
|
||||
private string RemoveSuffix(string str, string suffix)
|
||||
{
|
||||
if (str.EndsWith(suffix))
|
||||
return str.Substring(0, str.Length - suffix.Length);
|
||||
return str;
|
||||
}
|
||||
|
||||
private bool GetConfigFromNode(string node, out string[] foundConfig, out int foundIndex)
|
||||
{
|
||||
// for each entry in string[] config get every fifth element
|
||||
// if the first element is equal to the node, return the config
|
||||
Debug.Log("Getting config from node " + node);
|
||||
foundConfig = null;
|
||||
foundIndex = -1;
|
||||
string[] split = node.Split('.');
|
||||
string nodeType = split[0].ToLower();
|
||||
string nodeValue = split[1].ToLower();
|
||||
|
||||
//Debug.Log("Length of config: " + config.Length+ " length of entry: " + BoardEditorConfigEntry.length+" config length: " + configLength);
|
||||
for (int i = 0; i < configLength; i++)
|
||||
{
|
||||
string[] thisConfig = new string[BoardEditorConfigEntry.length];
|
||||
for (int j = 0; j < BoardEditorConfigEntry.length; j++)
|
||||
{
|
||||
thisConfig[j] = config[i * BoardEditorConfigEntry.length + j];
|
||||
}
|
||||
|
||||
string id = thisConfig[1];
|
||||
string idType = thisConfig[0];
|
||||
|
||||
//Debug.Log("Checking " + idType + "." + id + " against " + nodeType + "." + nodeValue);
|
||||
|
||||
if (idType.ToLower() == nodeType && id.ToLower() == nodeValue)
|
||||
{
|
||||
foundConfig = thisConfig;
|
||||
foundIndex = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
private void GetFormattedSupporter(int index)
|
||||
{
|
||||
DataDictionary supporterData = manager.GetSupporterData(index);
|
||||
DataToken supporterName = supporterData["name"];
|
||||
DataToken perkNodes = supporterData["pn"];
|
||||
if (supporterName.TokenType != TokenType.String)
|
||||
return;
|
||||
if (perkNodes.TokenType != TokenType.DataList)
|
||||
return;
|
||||
DataList perkNodeList = perkNodes.DataList;
|
||||
int perkNodeCount = perkNodeList.Count;
|
||||
bool reverseSearch = false;
|
||||
for (int i = 0; i < perkNodeCount; i++)
|
||||
{
|
||||
DataToken perkNode = reverseSearch ? perkNodeList[perkNodeCount-1-i] : perkNodeList[i];
|
||||
if (perkNode.TokenType != TokenType.String)
|
||||
continue;
|
||||
string node = perkNode.String;
|
||||
if (!GetConfigFromNode(node, out string[] foundConfig, out int foundIndex))
|
||||
continue;
|
||||
|
||||
string template = foundConfig[2];
|
||||
string separator = GetSeparator(foundConfig[3]);
|
||||
|
||||
string formatted = template.Replace("%s", supporterName.String);
|
||||
|
||||
string result = formatted + separator;
|
||||
string[] newArray = new string[_supporterListSeperated[foundIndex].Length + 1];
|
||||
for (int j = 0; j < _supporterListSeperated[foundIndex].Length; j++)
|
||||
{
|
||||
newArray[j] = _supporterListSeperated[foundIndex][j];
|
||||
}
|
||||
newArray[newArray.Length - 1] = result;
|
||||
_supporterListSeperated[foundIndex] = newArray;
|
||||
|
||||
|
||||
bool userMustBeInWorld = foundConfig[4] == "1";
|
||||
bool exclusive = foundConfig[5] == "1";
|
||||
|
||||
if (exclusive)
|
||||
break;
|
||||
}
|
||||
}
|
||||
private string[][] _supporterListSeperated;
|
||||
|
||||
private void ResetSupporterList()
|
||||
{
|
||||
_supporterListSeperated = new string[configLength][];
|
||||
for (int i = 0; i < configLength; i++)
|
||||
{
|
||||
_supporterListSeperated[i] = new string[0];
|
||||
}
|
||||
}
|
||||
private void UpdateSupporterList()
|
||||
{
|
||||
ResetSupporterList();
|
||||
int supporterCount = manager.SupporterCount;
|
||||
_supporterList = "";
|
||||
for (int i = 0; i < supporterCount; i++)
|
||||
{
|
||||
GetFormattedSupporter(i);
|
||||
}
|
||||
// loop through all the seperated lists and join them with the separator
|
||||
for (int i = 0; i < _supporterListSeperated.Length; i++)
|
||||
{
|
||||
for (int j = 0; j < _supporterListSeperated[i].Length; j++)
|
||||
{
|
||||
_supporterList += _supporterListSeperated[i][j];
|
||||
}
|
||||
|
||||
string separator = GetSeparator(config[i * BoardEditorConfigEntry.length + 3]);
|
||||
_supporterList = RemoveSuffix(_supporterList, separator);
|
||||
|
||||
if (i != _supporterListSeperated.Length - 1)
|
||||
_supporterList += GetSeparator(Separator);
|
||||
}
|
||||
|
||||
UpdateSupporterBoard(_supporterList);
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
//Debug.Log("Initializing supporter board component");
|
||||
}
|
||||
|
||||
protected override void OnImageDataUpdate() { }
|
||||
protected override void OnImageLoaded() { }
|
||||
|
||||
protected override void OnSupporterDataUpdate()
|
||||
{
|
||||
UpdateSupporterList();
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR && !UDONSHARP_COMPILER
|
||||
|
||||
[CustomEditor(typeof(VRCBoardSupporterBoardBase), true)]
|
||||
public class VRCBoardSupporterBoardBaseEditor : Editor
|
||||
{
|
||||
// with methods to serialize and deserialize the config arra
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (Application.isPlaying) return;
|
||||
//Debug.Log("EDITORRRR");
|
||||
EditorGUILayout.LabelField("Supporter Board Component");
|
||||
// apply the editorConfigEntries to config
|
||||
List<string> configList = new List<string>();
|
||||
VRCBoardSupporterBoardBase targetComponent = (VRCBoardSupporterBoardBase)base.target;
|
||||
BoardEditorConfigEntry[] editorConfigEntries = targetComponent.ConfigEntries;
|
||||
foreach (BoardEditorConfigEntry entry in editorConfigEntries)
|
||||
{
|
||||
configList.AddRange(entry.ToArray());
|
||||
}
|
||||
targetComponent.config = configList.ToArray();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
11
Components/VRCBoardSupporterBoardBase.cs.meta
Normal file
11
Components/VRCBoardSupporterBoardBase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0881a6e6e0907742a8eea495a9c061c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
665
Components/VRCBoardSupporterBoardTMP.asset
Normal file
665
Components/VRCBoardSupporterBoardTMP.asset
Normal file
@@ -0,0 +1,665 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardSupporterBoardTMP
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: e758930ddabc47d499d718189a2787b5,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: 670e2136f923f894789f2871f5134127, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 1
|
||||
hasInteractEvent: 0
|
||||
scriptID: -834845268903273143
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 11
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: manager
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: manager
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRCBoard.VRCBoardManager, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.Udon.UdonBehaviour, VRC.Udon
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 6|UnityEngine.HideInInspector, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _imageInitialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _imageInitialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _dataInitialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _dataInitialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _initialized
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _initialized
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: Separator
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: Separator
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 15|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ConfigEntries
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ConfigEntries
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 19|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRCBoard.Components.BoardEditorConfigEntry[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 20|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Object[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: config
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: config
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 24|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 24
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 26|UnityEngine.HideInInspector, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _supporterList
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _supporterList
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 15
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _supporterListSeperated
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _supporterListSeperated
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 30|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.String[][], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 20
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: text
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: text
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 33|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: TMPro.TextMeshPro[], Unity.TextMeshPro
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: textUGUI
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: textUGUI
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 36|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: TMPro.TextMeshProUGUI[], Unity.TextMeshPro
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
8
Components/VRCBoardSupporterBoardTMP.asset.meta
Normal file
8
Components/VRCBoardSupporterBoardTMP.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 486db5f9f0a8ce345a26bc8587a216a2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
27
Components/VRCBoardSupporterBoardTMP.cs
Normal file
27
Components/VRCBoardSupporterBoardTMP.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
namespace VRCBoard.Components
|
||||
{
|
||||
public class VRCBoardSupporterBoardTMP : VRCBoardSupporterBoardBase
|
||||
{
|
||||
public TMPro.TextMeshPro[] text;
|
||||
public TMPro.TextMeshProUGUI[] textUGUI;
|
||||
|
||||
protected override void UpdateSupporterBoard(string supporterList)
|
||||
{
|
||||
Debug.Log("Updating supporter board");
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
text[i].text = supporterList;
|
||||
}
|
||||
for (int i = 0; i < textUGUI.Length; i++)
|
||||
{
|
||||
textUGUI[i].text = supporterList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Components/VRCBoardSupporterBoardTMP.cs.meta
Normal file
11
Components/VRCBoardSupporterBoardTMP.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 670e2136f923f894789f2871f5134127
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user