-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChoices.cs
32 lines (24 loc) · 897 Bytes
/
Choices.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Design.DialogueEditor {
[System.Serializable]
public class DialogueChoice {
[HideInInspector] public int ID;
[HideInInspector] public Rect PositionInGrid;
public string ChoiceText;
public ChoiceConnection Connections;
[ShowInInspector] public List<System.Func<bool>> conditionsToAppear = new List<System.Func<bool>>();
public bool CanAppear() {
foreach (var con in conditionsToAppear) { if (!con()) { return false; } }
return true;
}
public void RefreshConnections() {
Connections.RefreshConnections(1);
Connections.RefreshConnections(2);
}
public DialogueChoice() { ID = -1; Connections = new ChoiceConnection(); }
public DialogueChoice(int id,Rect pos) { ID = id; PositionInGrid = pos; Connections = new ChoiceConnection(); }
}
}