-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerResponse.cs
More file actions
59 lines (48 loc) · 1.74 KB
/
PlayerResponse.cs
File metadata and controls
59 lines (48 loc) · 1.74 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using UnityEngine;
[Serializable]
public struct PlayerResponse
{
[SerializeField] private string namePlayer;
[Space]
[SerializeField] private PositiveResponse positiveResponse;
[Space]
[SerializeField] private NegativeResponse negativeResponse;
public string NamePlayer => namePlayer;
public PositiveResponse PositiveResponse => positiveResponse;
public NegativeResponse NegativeResponse => negativeResponse;
public bool HasMoreNpcDialogue()
{
return (positiveResponse.NpcResponse != null
|| negativeResponse.NpcResponse != null)
&& (positiveResponse.NpcResponse.NpcDialogue != string.Empty
|| negativeResponse.NpcResponse.NpcDialogue != string.Empty);
}
public bool HasMorePlayerDialogue()
{
return PositiveResponse.ReactPositive != string.Empty
&& negativeResponse.ReactNegative != string.Empty;
}
public PlayerResponse(string targetName = "You")
{
namePlayer = targetName;
positiveResponse = new PositiveResponse();
negativeResponse = new NegativeResponse();
}
}
[Serializable]
public struct PositiveResponse
{
[TextArea(0,15), SerializeField] private string reactPositive;
[SerializeField] private NPCDialogue npcResponse;
public string ReactPositive => reactPositive;
public NPCDialogue NpcResponse => npcResponse;
}
[Serializable]
public struct NegativeResponse
{
[TextArea(0,15), SerializeField] private string reactNegative;
[SerializeField] private NPCDialogue npcResponse;
public string ReactNegative => reactNegative;
public NPCDialogue NpcResponse => npcResponse;
}