public List <LVector3Int> DebugQueryCollider(EDir dir, LVector2 fTargetHead, LFloat size) { var ret = new List <LVector3Int>(); LVector2 borderDir = DirUtil.GetBorderDir(dir); var fBorder1 = fTargetHead + borderDir * size; var fBorder2 = fTargetHead - borderDir * size; var isColHead = HasCollider(fTargetHead); var isColBorder1 = HasCollider(fBorder1); var isColBorder2 = HasCollider(fBorder2); ret.Add(new LVector3Int(fTargetHead.Floor().x, fTargetHead.Floor().y, isColHead ? 1 : 0)); ret.Add(new LVector3Int(fBorder1.Floor().x, fBorder1.Floor().y, isColBorder1 ? 1 : 0)); ret.Add(new LVector3Int(fBorder2.Floor().x, fBorder2.Floor().y, isColBorder2 ? 1 : 0)); return(ret); }
public bool HasCollider(LVector2 pos) { var iPos = pos.Floor(); var id = _map2DService.Pos2TileId(iPos, true); return(id != 0 && id != TilemapUtil.TileID_Grass); }
public bool HasCollider(LVector2 pos) { var iPos = pos.Floor(); var id = _map2DService.Pos2TileId(iPos, true); return(id != 0); }
public static bool HasCollider(LVector2 pos) { var iPos = pos.Floor(); var id = MapManager.Instance.Pos2TileId(iPos, true); return(id != 0); }
public void CreateBullet(LVector2 pos, EDir dir, int type, GameEntity owner) { var createPos = pos.Floor().ToLVector2() + DirUtil.GetDirLVec(dir) + TankUtil.UNIT_SIZE; var entity = CreateUnit(createPos, _config.bulletPrefabs, type, dir, transParentBullet); entity.owner.localId = owner.localId.value; entity.unit.camp = owner.unit.camp; }
public bool IsOutOfBound(LVector2 fpos, LVector2Int min, LVector2Int max) { var pos = fpos.Floor(); if (pos.x < min.x || pos.x > max.x || pos.y < min.y || pos.y > max.y ) { return(true); } return(false); }
public static bool HasCollider(LVector2 pos) { return(HasCollider(pos.Floor())); }