private EntityInfo SetupInfoFor(InfoAnchor anchor, TileableBase source) { var instance = infoPool.CastSingle <EntityInfo>(); instance.RectTransform.SetParent(infoParent); instance.AssignTo(anchor, source); return(instance); }
public void AssignTo(InfoAnchor anchor, TileableBase source) { isActive = true; anchor.onDestroyed += OnAnchorDestroyed; this.anchor = anchor; Place(); this.source = source; Refresh(); }
public static TextAnchor AnchorPosition(InfoAnchor anchor) { if (anchor == InfoAnchor.Middle) { return(TextAnchor.MiddleLeft); } else if (anchor == InfoAnchor.Bottom) { return(TextAnchor.LowerLeft); } else { return(TextAnchor.UpperLeft); } }
void OnHoverStart(InfoAnchor anchor, TileableBase source) { if (hasHoverInfo) { return; } var check = spellInfos.Exists(info => info.Tile == source.Navigator.Current); if (check) { return; } hasHoverInfo = true; hoverInfo = SetupInfoFor(anchor, source); }