the OnClick() that you have a screen shot of only allows for 1 data component.
but you can have multiple OnClick() by clicking the + on the bottom right
let say you want to set a bool when button is clicked. or set a string or set an int
class Test : MonoBehaviour
{
public string name;
public int id;
public bool somebool;
public void boolClicked(bool fromclick)
{
somebool = fromclick;
}
public void setString(string fromclick)
{
name = fromclick;
}
public void intClicked(int fromclick)
{
id = fromclick;
}
}
Maybe I just asked it wrong, but that’s not what I thought.
Btw, got what I needed.
Final code:
using UnityEngine;
using System;
using System.Collections.Generic;
using UnityEngine.Serialization;
[System.Serializable]
public class DialogText
{
[Serializable]
public class DialogChoice
{
public string text;
public int triggerID;
public Boolean closeDialog = false;
[Serializable]
public class ButtonClickedEvent : UnityEngine.Events.UnityEvent { }
[FormerlySerializedAs("onClick")]
[SerializeField]
private ButtonClickedEvent m_OnClick = new ButtonClickedEvent();
}
public int id;
public int minRelationship = 0;
public string messageText;
public List<DialogChoice> responses = new List<DialogChoice>();
}