mirror of
https://git.aaro.dev/VRCBoard/vrcboard-udon.git
synced 2026-03-17 02:49:46 +00:00
Refactor VRCBoardImage component and remove unused shader/editor files
This commit is contained in:
@@ -168,6 +168,7 @@ namespace VRCBoard.Components
|
||||
Array.Resize(ref script.imageIds, newSize);
|
||||
Array.Resize(ref script.texturePropertyMappings, newSize);
|
||||
Array.Resize(ref script.defaultTextures, newSize);
|
||||
EditorUtility.SetDirty(script);
|
||||
}
|
||||
MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock();
|
||||
for (int i = 0; i < script.imageIds.Length; i++)
|
||||
@@ -194,12 +195,25 @@ namespace VRCBoard.Components
|
||||
defaultImage = EditorGUILayout.ObjectField(defaultImage, typeof(Texture2D), false) as Texture2D;
|
||||
EditorGUILayout.EndHorizontal();
|
||||
if (defaultImage != null) propertyBlock.SetTexture(propertyName, defaultImage);
|
||||
}
|
||||
|
||||
if (script.defaultTextures[i] != defaultImage)
|
||||
{
|
||||
script.defaultTextures[i] = defaultImage;
|
||||
|
||||
EditorUtility.SetDirty(script);
|
||||
}
|
||||
|
||||
script.imageIds[i] = imageId;
|
||||
if (selectedIndex >= 0 && selectedIndex < materialPropertyNames.Length) script.texturePropertyMappings[i] = materialPropertyNames[selectedIndex];
|
||||
if (script.imageIds[i] != imageId)
|
||||
{
|
||||
script.imageIds[i] = imageId;
|
||||
EditorUtility.SetDirty(script);
|
||||
}
|
||||
|
||||
if (selectedIndex >= 0 && selectedIndex < materialPropertyNames.Length && script.texturePropertyMappings[i] != materialPropertyNames[selectedIndex])
|
||||
{
|
||||
script.texturePropertyMappings[i] = materialPropertyNames[selectedIndex];
|
||||
EditorUtility.SetDirty(script);
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user