Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
public LateParticipant : MonoBehaviour {
    [Header("Properties")]
    [SerializeField]
    int _teamID;
    [SerializeField]
    bool _foundATeam => _teamID != -1;
    public UnityEvent<int> TeamAssigned;
    public void SetTeamID(int id){
        _teamID = id;
        TeamAssigned?.Invoke(_teamID);
    }
}
[CustomEditor(typeof(LateParticipant))]
public class LateParticipantEditor : Editor{
    int teamID = -1;
    public override OnInspectorGUI(){
        LateParticipant _lp = (LateParticipant)target;
        teamID = EditorGUILayout.IntField("TeamID",teamID);
        if(GUILayout.Button("SetTeam"){
            _lp.SetTeamID(teamID);
        }
    }
}