Currently tying to look inside the attachedSO to make a match but cant access the other scriptable details.
Basically character scriptable object with a scriptable object for the type of character;
public class CharacterSO : ScriptableObject
{
public Sprite CharacterSprite;
public string CharacterName;
public CharacterTypeSO CharacterType;
private void OnEnable()
{
CharacterName = this.name;
}
}
I can check if its a character with this but cant find how to also check that its say an Admin CharacterType;
private ScriptableObject soObjectToMatch;
public void OnDrop(PointerEventData eventData)
{
Debug.Log("DropHandler");
var attachedSO = eventData.pointerDrag.GetComponent<AttachedSO>().scriptableObject;
if (eventData.pointerDrag != null && attachedSO == soObjectToMatch)
{
Debug.Log(soObjectToMatch + " Dropped here");
}
else
{
Debug.Log(soObjectToMatch + " Dropped in wrong place");
}
}