Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
EloMapTileSelector.cs
Go to the documentation of this file.
1using System;
2using CreativeSpore.SuperTilemapEditor;
3using UnityEngine;
4
6{
8
9 public SpriteRenderer srHighlight;
10
11 public SpriteRenderer srHighlight2;
12
13 public SpriteRenderer srEmbarkPoint;
14
15 [NonSerialized]
16 public int gx;
17
18 [NonSerialized]
19 public int gy;
20
21 [NonSerialized]
22 public bool hasTargetChanged;
23
24 [NonSerialized]
25 public string textMouseOver;
26
28
29 public STETilemap fogmap => elomap.fogmap;
30
31 public void OnUpdateInput()
32 {
33 int mouseGridX = TilemapUtils.GetMouseGridX(fogmap, EMono.scene.cam);
34 int mouseGridY = TilemapUtils.GetMouseGridY(fogmap, EMono.scene.cam);
35 if (elomap.GetCell(mouseGridX, mouseGridY) != null && (mouseGridX != gx || mouseGridY != gy))
36 {
37 gx = mouseGridX;
38 gy = mouseGridY;
39 hasTargetChanged = true;
40 textMouseOver = "";
41 Zone zone = elomap.GetZone(gx, gy);
42 if (zone != null)
43 {
44 textMouseOver = textMouseOver + " " + zone.Name;
45 }
46 srHighlight.transform.position = TilemapUtils.GetGridWorldPos(fogmap, gx, gy);
47 }
48 else
49 {
50 hasTargetChanged = false;
51 }
52 bool enable = !EMono.ui.isPointerOverUI;
53 srHighlight.SetActive(enable);
54 srHighlight2.SetActive(enable: false);
55 srEmbarkPoint.SetActive(enable: false);
56 }
57}
Definition: EMono.cs:4
static Scene scene
Definition: EMono.cs:27
static UI ui
Definition: EMono.cs:15
EloMap elomap
Definition: EloMapActor.cs:7
SpriteRenderer srHighlight
SpriteRenderer srEmbarkPoint
SpriteRenderer srHighlight2
Definition: EloMap.cs:8
Cell GetCell(Point pos)
Definition: EloMap.cs:273
STETilemap fogmap
Definition: EloMap.cs:96
Zone GetZone(Point p)
Definition: EloMap.cs:420
Camera cam
Definition: Scene.cs:37
virtual string Name
Definition: Spatial.cs:495
Definition: Zone.cs:12