public static Tuple <int, int> Distance(TileObject t1, TileObject t2) { return(new Tuple <int, int> ((t2.CurrentIndex.Item1 - t1.CurrentIndex.Item1), (t2.CurrentIndex.Item2 - t1.CurrentIndex.Item2))); }
public static int MaxDistance(TileObject t1, TileObject t2) { var dis = AbsDistance(t1, t2); return(dis.Item1 > dis.Item2 ? dis.Item1 : dis.Item2); }
public static Tuple <int, int> AbsDistance(TileObject t1, TileObject t2) { return(new Tuple <int, int> (Mathf.Abs(t1.CurrentIndex.Item1 - t2.CurrentIndex.Item1), Mathf.Abs(t1.CurrentIndex.Item2 - t2.CurrentIndex.Item2))); }
private void Awake() { _tileObject = GetComponent <TileObject>(); _grid = FindObjectOfType <Grid>(); }
public Tuple <int, int> Distance(TileObject tileObj) { return(new Tuple <int, int> (Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1), Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2))); }
public int MaxDistance(TileObject tileObj) { return(Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1) > Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2) ? Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1) : Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2)); }
public void Release() { _occupator.tile = null; _occupator = null; }