Example #1
0
    private EntityInfo SetupInfoFor(InfoAnchor anchor, TileableBase source)
    {
        var instance = infoPool.CastSingle <EntityInfo>();

        instance.RectTransform.SetParent(infoParent);
        instance.AssignTo(anchor, source);

        return(instance);
    }
Example #2
0
    public void AssignTo(InfoAnchor anchor, TileableBase source)
    {
        isActive = true;

        anchor.onDestroyed += OnAnchorDestroyed;
        this.anchor         = anchor;
        Place();

        this.source = source;
        Refresh();
    }
Example #3
0
 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);
     }
 }
Example #4
0
    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);
    }