-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimatedConversation.cs
46 lines (40 loc) · 1.14 KB
/
AnimatedConversation.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
namespace XRL.World.Parts
{
[System.Serializable]
public class helado_BrewedBeverages_AnimatedConversation : IPart
{
public string ConversationID = null;
public void Check()
{
if (ParentObject.HasPart(typeof(Brain)))
{
var conversationScript =
ParentObject.GetPart<ConversationScript>();
if (conversationScript == null)
{
ParentObject.AddPart(
new ConversationScript(ConversationID)
);
}
else
{
conversationScript.ConversationID = ConversationID;
}
ParentObject.RemovePart(this);
}
}
public override void Register(GameObject go)
{
go.RegisterPartEvent(this, "AIWakeupBroadcast");
base.Register(go);
}
public override bool FireEvent(Event e)
{
if (e.ID == "AIWakeupBroadcast")
{
Check();
}
return true;
}
}
}