2024-08-03 22:24:42 +02:00
|
|
|
|
using UnityEngine;
|
2023-01-22 16:38:23 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace ABI.CCK.Components
|
|
|
|
|
{
|
2024-08-03 22:24:42 +02:00
|
|
|
|
[AddComponentMenu("ChilloutVR/Texture Property Parser")]
|
|
|
|
|
[HelpURL("https://developers.abinteractive.net/cck/components/texture-property-parser/")]
|
|
|
|
|
public class CVRTexturePropertyParser : MonoBehaviour, ICCK_Component
|
2023-01-22 16:38:23 +01:00
|
|
|
|
{
|
|
|
|
|
public enum TextureType
|
|
|
|
|
{
|
|
|
|
|
LocalTexture = 0,
|
|
|
|
|
GlobalTexture = 1,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TextureType textureType = TextureType.LocalTexture;
|
|
|
|
|
|
|
|
|
|
public RenderTexture texture;
|
|
|
|
|
public string globalTextureName = "";
|
|
|
|
|
|
|
|
|
|
public List<CVRTexturePropertyParserTask> tasks = new List<CVRTexturePropertyParserTask>();
|
|
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
|
public class CVRTexturePropertyParserTask
|
|
|
|
|
{
|
|
|
|
|
public int x = 0;
|
|
|
|
|
public int y = 0;
|
|
|
|
|
|
|
|
|
|
public enum Channel
|
|
|
|
|
{
|
|
|
|
|
r = 0,
|
|
|
|
|
g = 1,
|
|
|
|
|
b = 2,
|
|
|
|
|
a = 3,
|
|
|
|
|
}
|
|
|
|
|
public Channel channel = Channel.r;
|
|
|
|
|
|
|
|
|
|
private Vector4[] conversionTable = new Vector4[]
|
|
|
|
|
{
|
|
|
|
|
new Vector4(1, 0, 0, 0),
|
|
|
|
|
new Vector4(0, 1, 0, 0),
|
|
|
|
|
new Vector4(0, 0, 1, 0),
|
|
|
|
|
new Vector4(0, 0, 0, 1)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public float minValue = 0f;
|
|
|
|
|
public float maxValue = 1f;
|
|
|
|
|
|
|
|
|
|
public GameObject target;
|
|
|
|
|
public Component component;
|
|
|
|
|
|
|
|
|
|
public string propertyName = "";
|
|
|
|
|
public int typeIndex = 0;
|
|
|
|
|
public int targetIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|