Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
DramaEventMethod.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
5{
6 public Action action;
7
8 public Func<bool> endFunc;
9
10 public Func<string> jumpFunc;
11
12 public bool halt;
13
14 public bool hideDialog;
15
16 public DramaEventMethod(Action _action, float _duration = 0f, bool _halt = false)
17 {
18 action = _action;
19 time = _duration;
20 halt = _halt;
21 }
22
23 public override bool Play()
24 {
25 if (progress == 0)
26 {
27 if (hideDialog)
28 {
29 sequence.dialog.SetActive(enable: false);
30 }
31 if (action != null)
32 {
33 action();
34 }
35 if (time > 0f && !Input.GetKey(KeyCode.LeftControl))
36 {
37 TweenUtil.Tween(time, null, delegate
38 {
39 progress = -1;
40 });
41 progress++;
42 }
43 else
44 {
45 progress = -1;
46 }
47 }
48 if (EClass.ui.GetTopLayer() != base.layer)
49 {
50 if ((bool)sequence.dialog)
51 {
52 sequence.dialog.SetActive(enable: false);
53 }
54 return false;
55 }
56 if (progress == -1 || !halt || (endFunc != null && endFunc()))
57 {
58 if (jumpFunc != null)
59 {
60 string text = jumpFunc();
61 if (!text.IsEmpty())
62 {
63 sequence.Play(text);
64 return false;
65 }
66 }
67 return true;
68 }
69 return false;
70 }
71}
override bool Play()
DramaEventMethod(Action _action, float _duration=0f, bool _halt=false)
Func< bool > endFunc
Func< string > jumpFunc
DramaSequence sequence
Definition: DramaEvent.cs:15
float time
Definition: DramaEvent.cs:11
int progress
Definition: DramaEvent.cs:3
void Play(string id)
DialogDrama dialog
Definition: EClass.cs:5
static UI ui
Definition: EClass.cs:16