Can be but onto a toplevel object to provide date to children.
using Sirenix.OdinInspector;
using UnityAtoms.BaseAtoms;
using UnityEngine;
public enum SOSource
{
Single,
List,
}
public class SOProvider : MonoBehaviour
{
public SOSource source;
[ShowIf("@source == SOSource.Single")]public ScriptableObject scriptableObject;
[ShowIf("@source == SOSource.List")]public ScriptableObjectList scriptableObjectList;
[ShowIf("@source == SOSource.List")]public IntReference index;
public ScriptableObject Get() => source == SOSource.Single ? scriptableObject : scriptableObjectList.objects[index.Value];
}
using UnityAtoms.BaseAtoms;
using UnityEngine;
public enum SOSource
{
Single,
List,
}
public class SOProvider : MonoBehaviour
{
public SOSource source;
public ScriptableObject scriptableObject;
public ScriptableObjectList scriptableObjectList;
public IntReference index;
public ScriptableObject Get() => source == SOSource.Single ? scriptableObject : scriptableObjectList.objects[index.Value];
}
using Sirenix.OdinInspector;
using UnityEngine;
public enum SOSource
{
Single,
List,
}
public class SOProvider : MonoBehaviour
{
public SOSource source;
[ShowIf("@source == SOSource.Single")]public ScriptableObject scriptableObject;
[ShowIf("@source == SOSource.List")]public ScriptableObjectList scriptableObjectList;
[ShowIf("@source == SOSource.List")]public int index
public ScriptableObject Get() => source == SOSource.Single ? scriptableObject : scriptableObjectList.objects[index];
}
using UnityEngine;
public enum SOSource
{
Single,
List,
}
public class SOProvider : MonoBehaviour
{
public SOSource source;
public ScriptableObject scriptableObject;
public ScriptableObjectList scriptableObjectList;
public int index
public ScriptableObject Get() => source == SOSource.Single ? scriptableObject : scriptableObjectList.objects[index];
}