Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetDebug.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3
4public class WidgetDebug : Widget
5{
6 public static string output;
7
8 public Text debugText;
9
10 public Text textFPS;
11
12 public bool showUpdates;
13
14 public bool showProps;
15
16 public bool showOther;
17
18 private Timer.TimerItem timer;
19
20 private float deltaTime;
21
22 private int lastPathCount;
23
24 public override void OnActivate()
25 {
26 UpdateText();
27 }
28
29 private void OnEnable()
30 {
31 if ((bool)Timer.current)
32 {
33 timer = Timer.Start(0.1f, UpdateText, repeat: true);
34 }
35 }
36
37 private void OnDisable()
38 {
39 if (timer != null)
40 {
41 timer.Cancel();
42 }
43 }
44
45 public void Refresh()
46 {
47 }
48
49 public void ToggleProps()
50 {
52 }
53
54 public void ToggleUpdates()
55 {
57 }
58
59 public void ToggleOther()
60 {
62 }
63
64 private void UpdateText()
65 {
66 deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
67 float num = deltaTime * 1000f;
68 float num2 = 1f / deltaTime;
69 string text = $"{num:0.0} ms ({num2:0.} fps)";
70 textFPS.text = text + " avg delta: " + Core.avgDelta;
71 if (EMono.game == null || EMono.game.activeZone == null)
72 {
73 debugText.text = "";
74 return;
75 }
79 int num3 = PathManager.requestCount - lastPathCount;
81 Point hitPoint = Scene.HitPoint;
82 text = "";
83 if (showOther)
84 {
85 text += output;
86 text = text + EMono.pc.ai?.ToString() + "/" + EMono.pc.ai.status.ToString() + "\n";
87 text = text + "time: " + EMono.scene.timeRatio + " turn:" + EMono.pc.turn + " ";
88 _ = EInput.mposWorld;
89 if (tileMap != null)
90 {
91 text = text + "mouse: " + tileMap.mx + "/" + tileMap.mz + " hit: " + hitPoint?.ToString() + "\n";
93 {
94 Point point = hitPoint.Copy();
97 text = text + "mouse: " + (tileMap.mx + EMono.scene.elomapActor.elomap.minX) + "/" + (tileMap.mz + EMono.scene.elomapActor.elomap.minY) + " hit: " + point?.ToString() + "\n";
98 }
99 }
100 float num4 = (EMono.pc.renderer.actor as CharaActorPCC)?.provider.angle ?? 0f;
101 text = text + "path:" + num3 + "/" + PathManager.requestCount + "/" + PathManager.Instance._pathfinder.total + " syncList:" + EMono.scene.syncList.Count + "\n";
102 text = text + "events:" + EMono._zone.events.list.Count + " roundTimer:" + EMono.pc.roundTimer + " seed:" + EMono._map.seed + "\n";
103 text = text + "details:" + CellDetail.count + "(" + CellDetail.cache.Count + " pointAnimes:" + EMono._map.pointAnimes.Count + ") pccCache:" + PCCManager.current.pccCache.Count + "\n";
104 if (hitPoint.IsValid)
105 {
106 text = text + "GatAngle: " + Util.GetAngle(hitPoint.x - EMono.pc.pos.x, hitPoint.z - EMono.pc.pos.z) + " dir: " + EMono.pc.dir + " actor dir: " + EMono.pc.renderer.actor?.currentDir + " angle:" + EMono.pc.angle + "/" + num4 + "\n";
107 text = text + "room: " + hitPoint.cell.room?.ToString() + " objVal:" + hitPoint.cell.objVal + " " + hitPoint.cell.CanGrow(hitPoint.cell.sourceObj, new VirtualDate(1));
108 }
109 }
110 if (showUpdates)
111 {
112 text += EMono.game.updater.GetText();
113 text += "\n";
114 }
115 if (showProps)
116 {
117 text = text + "roaming: " + props.roaming.Count + "\n";
118 text = text + "installed: " + props.installed.Count + "\n";
119 text = text + "charas: " + EMono._map.charas.Count + "\n";
120 text = text + "global charas: " + EMono.game.cards.globalCharas.Count + "\n";
121 text += "\n";
122 }
123 if (hitPoint.IsValid && hitPoint.FirstChara != null)
124 {
125 text += "\n";
126 Chara firstChara = hitPoint.FirstChara;
127 text = text + firstChara.id + " uid:" + firstChara.uid + " skin:" + firstChara.idSkin + " dir:" + firstChara.dir;
128 }
129 debugText.text = text;
130 }
131}
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Status status
Definition: AIAct.cs:16
override string ToString()
Definition: AIAct.cs:124
BaseTileMap tileMap
virtual int currentDir
Definition: CardActor.cs:41
CardActor actor
Definition: CardRenderer.cs:11
Point pos
Definition: Card.cs:55
float roundTimer
Definition: Card.cs:65
int dir
Definition: Card.cs:142
CardRenderer renderer
Definition: Card.cs:57
static int count
Definition: CellDetail.cs:5
static Stack< CellDetail > cache
Definition: CellDetail.cs:9
Room room
Definition: Cell.cs:102
SourceObj.Row sourceObj
Definition: Cell.cs:1072
bool CanGrow(SourceObj.Row obj, VirtualDate date)
Definition: Cell.cs:1649
Definition: Chara.cs:10
AIAct ai
Definition: Chara.cs:187
Definition: Core.cs:14
static float avgDelta
Definition: Core.cs:19
PathManager pathManager
Definition: Core.cs:35
Definition: EInput.cs:8
static Vector3 mposWorld
Definition: EInput.cs:339
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
static Chara pc
Definition: EMono.cs:13
static Zone _zone
Definition: EMono.cs:19
static BaseGameScreen screen
Definition: EMono.cs:29
static Game game
Definition: EMono.cs:7
static Scene scene
Definition: EMono.cs:27
static Map _map
Definition: EMono.cs:17
EloMap elomap
Definition: EloMapActor.cs:7
int minX
Definition: EloMap.cs:112
int minY
Definition: EloMap.cs:114
string GetText()
Definition: GameUpdater.cs:552
Zone activeZone
Definition: Game.cs:245
GameUpdater updater
Definition: Game.cs:243
PropsManager props
Definition: Map.cs:91
int seed
Definition: Map.cs:19
List< TransAnime > pointAnimes
Definition: Map.cs:83
IPathfinder pathfinder
Definition: PathManager.cs:24
PathFinder _pathfinder
Definition: PathManager.cs:20
static PathManager Instance
Definition: PathManager.cs:16
static int requestCount
Definition: PathManager.cs:14
Definition: Point.cs:9
Point Copy()
Definition: Point.cs:467
override string ToString()
Definition: Point.cs:500
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsValid
Definition: Point.cs:88
Chara FirstChara
Definition: Point.cs:264
Cell cell
Definition: Point.cs:51
override string ToString()
Definition: Room.cs:31
Definition: Scene.cs:8
List< ISyncScreen > syncList
Definition: Scene.cs:131
static Point HitPoint
Definition: Scene.cs:21
EloMapActor elomapActor
Definition: Scene.cs:97
virtual bool IsRegion
Definition: Spatial.cs:501
void OnDisable()
Definition: WidgetDebug.cs:37
static string output
Definition: WidgetDebug.cs:6
float deltaTime
Definition: WidgetDebug.cs:20
void Refresh()
Definition: WidgetDebug.cs:45
Text textFPS
Definition: WidgetDebug.cs:10
void ToggleProps()
Definition: WidgetDebug.cs:49
Text debugText
Definition: WidgetDebug.cs:8
void ToggleUpdates()
Definition: WidgetDebug.cs:54
bool showProps
Definition: WidgetDebug.cs:14
void OnEnable()
Definition: WidgetDebug.cs:29
int lastPathCount
Definition: WidgetDebug.cs:22
bool showOther
Definition: WidgetDebug.cs:16
Timer.TimerItem timer
Definition: WidgetDebug.cs:18
bool showUpdates
Definition: WidgetDebug.cs:12
void UpdateText()
Definition: WidgetDebug.cs:64
void ToggleOther()
Definition: WidgetDebug.cs:59
override void OnActivate()
Definition: WidgetDebug.cs:24
Definition: Widget.cs:7
List< ZoneEvent > list
ZoneEventManager events
Definition: Zone.cs:40