public void Shoot(UnitTB tgt, AttackInstance aInstance, bool missed) { attMissed=missed; float val=GridManager.GetTileSize()/(missed ? 2f : 8); offsetPos=new Vector3(Random.Range(-val, val), Random.Range(0, val/2), Random.Range(-val, val)); targetUnit=tgt; if(tgt!=null) targetPos=targetUnit.GetTargetT().position+offsetPos; if(tgt!=null) targetTile=targetUnit.occupiedTile; Shoot(aInstance); }
public void Shoot(UnitTB tgt, AttackInstance aInstance, bool missed) { attMissed = missed; float val = GridManager.GetTileSize() / (missed ? 2f : 8); offsetPos = new Vector3(Random.Range(-val, val), Random.Range(0, val / 2), Random.Range(-val, val)); targetUnit = tgt; if (tgt != null) { targetPos = targetUnit.GetTargetT().position + offsetPos; } if (tgt != null) { targetTile = targetUnit.occupiedTile; } Shoot(aInstance); }