mirror of
https://git.aaro.dev/VRCBoard/vrcboard-udon.git
synced 2026-03-17 02:49:46 +00:00
feat: GitHub integration and URL management
All checks were successful
Create Unity Package / package (push) Successful in 8s
All checks were successful
Create Unity Package / package (push) Successful in 8s
This commit is contained in:
@@ -20,12 +20,14 @@ namespace VRCBoard.Components
|
||||
public abstract class VRCBoardBaseComponent : UdonSharpBehaviour
|
||||
{
|
||||
[HideInInspector] public VRCBoardManager manager;
|
||||
protected virtual void OnRegister() {}
|
||||
protected virtual void OnInitialize() {}
|
||||
protected virtual void OnSupporterDataUpdate() {}
|
||||
protected virtual void OnImageDataUpdate() {}
|
||||
|
||||
protected abstract void OnRegister();
|
||||
protected abstract void OnInitialize();
|
||||
protected abstract void OnSupporterDataUpdate();
|
||||
protected abstract void OnImageDataUpdate();
|
||||
protected abstract void OnImageLoaded();
|
||||
protected virtual void OnImageLoaded() {}
|
||||
|
||||
protected virtual void OnCustomModuleUpdate(int inputModuleIndex, DataDictionary data) {}
|
||||
|
||||
protected internal void _Register(VRCBoardManager _manager)
|
||||
{
|
||||
@@ -68,7 +70,7 @@ namespace VRCBoard.Components
|
||||
|
||||
protected internal void _OnCustomModuleUpdate(int moduleIndex, DataDictionary data)
|
||||
{
|
||||
Debug.Log("Custom module update");
|
||||
OnCustomModuleUpdate(moduleIndex, data);
|
||||
}
|
||||
|
||||
protected internal void _OnAtlasImageLoaded(int atlasIndex = -1)
|
||||
|
||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardImage
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 19ae0697d87c22c40b5eceb361997922,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: f83f88ce349d298438a783df6b33c10f,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@@ -6,6 +6,7 @@ using VRC.SDK3.Data;
|
||||
|
||||
using UnityEditor;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common.Enums;
|
||||
|
||||
namespace VRCBoard.Components
|
||||
{
|
||||
@@ -44,12 +45,6 @@ namespace VRCBoard.Components
|
||||
|
||||
if (imageIds.Length == 0) return;
|
||||
_uploaderId = GetUploader(imageIds[0]);
|
||||
|
||||
if (string.IsNullOrEmpty(_uploaderId))
|
||||
{
|
||||
Debug.LogWarning("Failed to get uploader ID");
|
||||
//return;
|
||||
}
|
||||
for (int i = 0; i < imageIds.Length; i++)
|
||||
{
|
||||
string imageId = imageIds[i];
|
||||
@@ -73,13 +68,8 @@ namespace VRCBoard.Components
|
||||
TryGetUploader();
|
||||
}
|
||||
|
||||
protected override void OnImageLoaded()
|
||||
public void _ApplyImageToMaterial()
|
||||
{
|
||||
//Debug.Log("Image loaded VRCBoardImage");
|
||||
|
||||
|
||||
//bool textureSuccess = GetImageAtlasTexture(albedoImageId, _uploaderId, out Texture2D texture, out int atlasPosition, out int atlasSize, out string type1);
|
||||
|
||||
MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock();
|
||||
|
||||
for (int i = 0; i < imageIds.Length; i++)
|
||||
@@ -102,6 +92,11 @@ namespace VRCBoard.Components
|
||||
|
||||
if (_renderer) _renderer.SetPropertyBlock(propertyBlock,materialIndex);
|
||||
}
|
||||
protected override void OnImageLoaded()
|
||||
{
|
||||
if (manager == null) return;
|
||||
SendCustomEventDelayedFrames(nameof(_ApplyImageToMaterial), manager.waitIndex++, EventTiming.LateUpdate);
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR && !COMPILER_UDONSHARP
|
||||
[CustomEditor(typeof(VRCBoardImage), true)]
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace VRCBoard.Components
|
||||
GetImageAtlasTexture(imageId, 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");
|
||||
//Debug.LogError("Failed to get image type for albedo image");
|
||||
return "";
|
||||
}
|
||||
string _mainType = albedoType;
|
||||
@@ -30,26 +30,14 @@ namespace VRCBoard.Components
|
||||
}
|
||||
else if (_mainType == "global")
|
||||
{
|
||||
uploaderId = null;
|
||||
uploaderId = "null";
|
||||
}
|
||||
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;
|
||||
uploaderId = manager._VRCBoardIdFromName(manager.InstanceOwner);
|
||||
}
|
||||
|
||||
Debug.Log("image uploader: " + uploaderId);
|
||||
//Debug.Log("image uploader: " + uploaderId);
|
||||
} else
|
||||
{
|
||||
uploaderId = uploaderIdOverride;
|
||||
|
||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardImageBasic
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 7111a5f4b78f7a94fb3d6ae9aef3b9d4,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: dfe93a97c46c4cf4c95cfe80dcaa0d3e,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@@ -54,11 +54,6 @@ namespace VRCBoard.Components
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_uploaderId)) return;
|
||||
_uploaderId = GetUploader(albedoImageId);
|
||||
if (string.IsNullOrEmpty(_uploaderId))
|
||||
{
|
||||
Debug.LogWarning("Failed to get uploader ID");
|
||||
//return;
|
||||
}
|
||||
RequestImageLoad(albedoImageId, _uploaderId);
|
||||
RequestImageLoad(emissionImageId, _uploaderId);
|
||||
RequestImageLoad(normalImageId, _uploaderId);
|
||||
@@ -79,7 +74,7 @@ namespace VRCBoard.Components
|
||||
|
||||
protected override void OnImageLoaded()
|
||||
{
|
||||
Debug.Log("Image loaded VRCBoardImage");
|
||||
//Debug.Log("Image loaded VRCBoardImage");
|
||||
|
||||
Texture2D albedoTexture;
|
||||
int albedoAtlasPosition;
|
||||
|
||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardOverheadIcons
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 9b52c5e5b2955fa468b15a65e066455d,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 4d130d8e384312146b0f690571220be5,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace VRCBoard.Components
|
||||
{
|
||||
// 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);
|
||||
//Debug.Log("Getting config from node " + node);
|
||||
foundConfig = null;
|
||||
foundIndex = -1;
|
||||
string[] split = node.Split('.');
|
||||
|
||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: VRCBoardSupporterBoardTMP
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: cb7ba44e9b1599548a81a4691eb88bb4,
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: e758930ddabc47d499d718189a2787b5,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
|
||||
Reference in New Issue
Block a user